R Programming Flashcards
A popular programming language used for statistical computing and graphical presentation
its most common use is to analyze and visualize data
R
R is case sensitive
True
R execution command
Ctrl a + alt enter to run/
Select + alt enter to run
How to input string?
inside double quotation marks
How to input numbers?
As is
There is a multiline comment in R
False
use ________________ for single line comment
#
containers for storing data values
Variable
R does not have a command for declaring a variable
True
You do not have to use a function to output or print
True
is created the moment you first assign a value to it
Variable
How to assign a variable?
use <- assignment operator
How to out to input or print the variable value?
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)
You can also ________________, or join two or more elements using the paste() function
Concatenate
R allows you to assign the same value in multiple variables in one line
True
You CAN use any variable name in R ptogramming
False
There only legal variables to use in R
myvar <- “John”
my_var <- “John”
myVar <- “John”
MYVAR <- “John”
myvar2 <- “John”
myvar <- John
Legal Variable Names
Variable should not start with number
True
No other symbols other than underscore in a variable name
True
There should be no white spaces in a variable name
True
Variable name should not start with underscores
True
no other symbols other than underscore
True
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
Illegal Variable Names
We can use the ____________function to check the data type
class()