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

19
Q

No other symbols other than underscore in a variable name

20
Q

There should be no white spaces in a variable name

21
Q

Variable name should not start with underscores

22
Q

no other symbols other than underscore

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

25
number followed by L
Integer
26
Numeric data without decimals
Integer
27
Used when you are certain that you will never create a variable that could contain a decimal
Integer
28
A ____________ number is written with an “i” as the imaginary part
Complex
29
You can convert from one type to another
True
30
You can convert from one type to another with the following functions:
as.numeric() as.integer() as.complex()
31
There are three basic constructs to consider:
Iteration - repeated until condition is met Sequence - top to bottom Selection or conditional - selected conditionally
32
Three condition statements
if statement Else if statement If else statement
33
R also has many ____________ functions that allows you to perform mathematical tasks on numbers
Built-in Math Functions
34
____________ and ____________ functions can be used to find the lowest or highest number in a set
the min() and max()
35
Built-in Math Functions that gets the square root of a number
sqrt()
36
gets the non-negative value of the inputted value
abs()
37
returns the smallest integer that is greater than or equal to the number whose ceiling needs to be calculated
ceiling()
38
returns the largest integer that is smaller than or equal to value passed to it as argument
floor()
39
series of statements are skipped and jumps to another statement under a particular condition
Branching
40
Ilegal Variable Names
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