Here, I briefly describe what each method used in the tutorial does. If you want extra information on the method, read the help page! (?method_name
).
read.csv()
: returns a data frame with the data stored in a csv file.
mean()
: returns the mean of a variable.
var()
: returns the variance of a variable.
sd()
: returns the standard deviation of a variable.
median()
: returns the median of a variable.
summary()
: returns a collection of summary statistics for a variable; mix, max, median, mean, 1st quartile and 3rd quartile.
tapply()
: apply a method (e.g. mean()
) to a variable using a grouping factor (e.g. Genus)
levels()
: returns the levels of a factor.
strsplit()
: splits a string into pieces whenever a separator (e.g. “,”) occurs.
as.character()
: cast an object to character. This the same as to say, treat this as if it was a character.
data.frame()
: object to store data matrices.
cbind()
: combine columns; you mostly used it to add columns to a dataset. The method rbind()
works for rows.
sqrt()
: returns the square root of a number.
length()
: returns the length of a list.
names()
: returns the names of the variables within an objects. You can use it to return the names of the columns in a data frame.
ls()
: list the objects in my workspace.
rm()
: remove an object in my workspace.
head()
: return the first 10 lines of a data frame
na.omit
: ignore rows with missing data (NA)
do.call
: constructs and executes a function call from a name or a function and a list of arguments to be passed to it. (I took this directly from the help page!)