RStudio Commands/Basics: Labs 1-4 Flashcards
What is the command for square root?
sqrt (x)
What is the command for assigning a variable title to a number or operation?
variable letter/title <- # or operation
What is the command for absolute value?
Abs (x)
What is the command for rounding a number up?
Round (X, # of digits to round to)
What is the command for identifying the data type of the variable?
typeof (x)
What is the command for confirming the data type of the variable?
is.typeofdata (x)
What is the command for creating a vector?
c(x, x, x, x, x, x…)
What is the command for titling a vector?
title of vector <- c(x, x, x, x, x….)
What is the command for repeating vectors?
variable title <- rep(value, times=# to be repeated)
What is the command for a sequence of numbers?
from#:to#
What is the command for combining vectors of data to make a data frame?
data_name = data.frame(variable_1….,variable_f)
What is the command for isolating data that meets a certain condition?
subset(data_name, condition of subset)
What is the command for filtering items of the same data?
data_name%>%filter(vectortitle==”item wanted”)
What is the command for calculating the mean of a vector?
mean(data_name$vector name
What is the command for calculating a summary of the data in a vector (IQR, Q1, Median, Q3, min/max)?
summary(data_name$vector name)