R Programming Flashcards

1
Q

A popular programming language used for statistical computing and graphical presentation

its most common use is to analyze and visualize data

A

R

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

R is case sensitive

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

R execution command

A

Ctrl a + alt enter to run/
Select + alt enter to run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to input string?

A

inside double quotation marks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to input numbers?

A

As is

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

There is a multiline comment in R

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

use ________________ for single line comment

A

#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

containers for storing data values

A

Variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

R does not have a command for declaring a variable

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

You do not have to use a function to output or print

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

is created the moment you first assign a value to it

A

Variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to assign a variable?

A

use <- assignment operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to out to input or print the variable value?

A

Just type the variable name or use use print()function

variable name
Name <- “John”
Age <- 40
Name
Age

use print()

Name <- “John”
Age <- 40
print(Name)
print(Age)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

You can also ________________, or join two or more elements using the paste() function

A

Concatenate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

R allows you to assign the same value in multiple variables in one line

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

You CAN use any variable name in R ptogramming

A

False
There only legal variables to use in R

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

myvar <- “John”
my_var <- “John”
myVar <- “John”
MYVAR <- “John”
myvar2 <- “John”
myvar <- John

A

Legal Variable Names

18
Q

Variable should not start with number

A

True

19
Q

No other symbols other than underscore in a variable name

A

True

20
Q

There should be no white spaces in a variable name

A

True

21
Q

Variable name should not start with underscores

A

True

22
Q

no other symbols other than underscore

A

True

23
Q

2myvar <- “John”
should not start with number

my-var <- “John”
no other symbols other than underscore

my var <- “John”
no white spaces

_my_var <- “John”
should not start with underscores

my_v@ar <- “John”
no other symbols other than underscore

TRUE <- “John”
do not use a reserved code, in this case it is Boolean

A

Illegal Variable Names

24
Q

We can use the ____________function to check the data type

A

class()

25
Q

number followed by L

A

Integer

26
Q

Numeric data without decimals

A

Integer

27
Q

Used when you are certain that you will never create a variable that could contain a decimal

A

Integer

28
Q

A ____________ number is written with an “i” as the imaginary part

A

Complex

29
Q

You can convert from one type to another

A

True

30
Q

You can convert from one type to another with the following functions:

A

as.numeric()
as.integer()
as.complex()

31
Q

There are three basic constructs to consider:

A

Iteration - repeated until condition is met
Sequence - top to bottom
Selection or conditional - selected conditionally

32
Q

Three condition statements

A

if statement
Else if statement
If else statement

33
Q

R also has many ____________ functions that allows you to perform mathematical tasks on numbers

A

Built-in Math Functions

34
Q

____________ and ____________ functions can be used to find the lowest or highest number in a set

A

the min() and max()

35
Q

Built-in Math Functions that gets the square root of a number

A

sqrt()

36
Q

gets the non-negative value of the inputted value

A

abs()

37
Q

returns the smallest integer that is greater than or equal to the number whose ceiling needs to be calculated

A

ceiling()

38
Q

returns the largest integer that is smaller than or equal to value passed to it as argument

A

floor()

39
Q

series of statements are skipped and jumps to another statement under a particular condition

A

Branching

40
Q

Ilegal Variable Names

A

should not start with number
no other symbols other than underscore
no white spaces
should not start with underscores
no other symbols other than underscore
do not use a reserved code, in this case it is Boolean