Title | R Dictionary |
---|---|
Author | Madeleine McDonald |
Course | Statistics for Biologists |
Institution | University of Virginia |
Pages | 1 |
File Size | 120.6 KB |
File Type | |
Total Downloads | 63 |
Total Views | 183 |
R dictionary- required dictionary of functions used in R studio ...
Function
What it does
c()
Creates a new vector by combining list of c (2, 5, 8) values Tells you what type of object something is
class ( )
Example
names() str( )
Look at structure of data set, tells you number of observations and variables
str(data)
Dim ()
Gives you dimensions of data frame
Dim(calcium)
mean()
Calculates mean
min()
Gives you smallest of the number set
head ()
summary() sd()
Standard deviation
sd(data$fev,na.rm=TRUE)
Quantile () IQR()
Calculates quantile of your data set, put . 25 for first OR .75 for third Calculates IQR for data set
Quantile(data$calcium, .25, na.rm= TRUE) IQR(data$fev,na.rm=TRUE)
Median()
Gives you median of data
median(data$fev,na.rm=TRUE)
Cor(dataframe)
Calculates correlation coefficient
cor(bodyfat$percent.fat, bodyfat$neck.circum..cm)
lm(y ~ x)
Gives linear regression of two vectors
Resid()
Gives individual residual values for model
Resid(model)
Fitted()
Gives individual fitted values for model
Fitted(model)...