Exam Questions and CORRECT Answers
multiply function - CORRECT ANSWER -*
exponent function - CORRECT ANSWER -^
divide function - CORRECT ANSWER -/
vectors - CORRECT ANSWER - are variables with an ordered set of values
square root function - CORRECT ANSWER - sqrt()
can a vector be named with a digit followed by a digit? - CORRECT ANSWER - no
can a vector be named by a digit followed by a period? - CORRECT ANSWER - no
are vector names case sensitive? - CORRECT ANSWER - yes
code to return the sequence of numbers 2 3 4 5 - CORRECT ANSWER - >seq(2,5)
or
>2:5
result of
>(x<-seq(2,5)) - CORRECT ANSWER - [1] 2 3 4 5
the extra parentheses give the instruction to print to screen
, function to result in a list of current objects - CORRECT ANSWER - objects()
>x<-"Hello"
>y<-"World"
>W<-c(x,y)
what's the result? - CORRECT ANSWER - [1] "Hello" "World"
>x<-"Hello"
>y<-"World"
>paste(x,y) - CORRECT ANSWER - [1] "Hello World"
date() - CORRECT ANSWER - returns current date and time
function to access a data set and indicate to R it is the data set of interest - CORRECT
ANSWER - data()
function to view a data set in top left window - CORRECT ANSWER - View()
symbol used to access a specific variable in a data set - CORRECT ANSWER -$
example: you want to access the uptake variable in the data set CO2
>CO2$uptake
5 basic data types in R - CORRECT ANSWER - Logical
Integer
Numeric
Complex
Character