1/23
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is the R code for the seven basic mathematical operators?
Addition +
Subtraction -
Multiplication *
Division /
Exponentiation ^
Square Root function sqrt(x)
Logarithmic function log(x)
What is a variable in R?
A variable allows the storing of a value or object as any data type
Variables are assigned using the <- assignment operator
What are the 5 common data types used in R?
Numeric - numbers or contain decimals
Integer - numeric data without decimals
Character - Text strings
Factor - Categorical data with limited levels
Logical - Boolean values, TRUE or FALSE
What comparison and logical operators are used in R?
less than
greater than
less than or equal to
greater than or equal to
equal to
not equal to
AND
OR
< > <= >= == != & |
What R function gives the first 6 rows of the data frame?
head()
What R function gives the last 6 rows of the data frame?
tail()
What R function gives an overview of a data frames structure?
str()
What R function gives the column names of a data frame?
names()
What R function gives the five number summary of the data fram?
summary()
What R function gives the dimension of the data frame?
dim()
What R function specifies a start value, end value of step size?
seq()
What R function creates sequences with repeating patternns?
rep()
What R function combines elements into data structures?
c()
What R function determines a data type?
class()
What R function converts data to a different data type?
as.new_data_type()
What R function determines the categories within a factor variable?
levels()
What does the colon operator : do?
Creates simple integer sequences with an increment of one
What do the following R functions do?
sqrt()
log()
abs()
mean()
sd()
median()
sqrt() - computes the square root
log() - computes natural logarithms
abs() - computes absolute value
mean() - gives arithmetic mean
sd() - computes standard deviation
median() - computes the sample median
What R function allows a data set to be viewed in a spreadsheet style?
View()
What functions are useful when working with packages?
install.packages("package name")
require("package name")
library("package name")
What is a conditional statement and how is it set out in R?
The if statement is used for execution of code only when the specified condition is TRUE
An else statement can be used in conjunction with the if statement to provide alternative code to execute when the condition is FALSE

What types of loops are useful in R?
Loops are used in R to repeatedly execute a block of code
The for loop is used to repeat a block of code for each element in a sequence
With the while loop, a block of code is repeatedly executed as long as a specified condition remains TRUE
The repeat loop executes a block of code until a break statement is encountered within the loop
What do the following R functions do?
plot()
hist()
barplot()
plot() -
hist() - computes a histogram of given data
barplot() - creates a bar plot with vertical/ horizontal bars
What R function shows every column in a data frame and shows as much data as possible?
glimpse()