R Functions Flashcards
(118 cards)
abline()
Adds straight line to a plot. v = “” puts a vertical line at corresponding to a specific coordinate.
abs()
Absolute value
apply()
apply(x, margin, fun)
x = dataframe, matrix, etc.
margin = parameter
fun = function to apply to data
as.character()
convert to character vectors
as.numeric
converts data to numeric values
as.vector
converts data to a vector (returns r vector)
attach()
turns all variables in dataframe into their own objects
barplot()
creates a barplot
boot()
IDK
boot.ci()
IDK
boxplot()
creates a boxplot
by()
localized function. allows us to apply a function toa certain subsect of a data frame
by(data, indices, fun)
data = dataframe, vector, etc.
indices: defines data points that will be split into certain subsets
fun: function that will act on component
AKA by() performs FUN on DATA for each INDICE
c()
concatanate. combines things into a vector
calcTemp()
IDK
cbind()
combines multiple vectors (or matrices or dataframes) by their columns
cex()
allows u to change size of characters
class()
IDK
cleanNHdata
IDK // i mean i kinda do know but is this a real fx they would want us to use…
colnames()
returns OR sets the names of columns
to set names of columns:
colnames(df) <- c(“x”, “y”, “z”)
colors()
specifies color (usually in a plot of some sort)
colSums()
IDK/come back
complete.cases()
IDK/come back
convertTimes()
IDK/come back
data.frame()
turns something into a data frame? IDK/come back