1/42
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
c()
Combines values into a vector
dim()
Finds dimension of an object
head()
Returns the first part of a vector, matrix, table, data frame, or function
length()
Finds length of vector
names()
Find the names of the variables in a data frame
max()
Finds the maximum of the input values
min()
Finds the minimum of the input values
mean()
Finds the mean of the input values
read.csv()
Reads a file in table format and creates a data frame from it
sum()
Finds the sum of the input values
View()
View data frame in a spreadsheet-style format
Vector
Is an ordered collection of numbers, words, and generally ‘objects’ in R. Use c() function
Why is it important to add comments
Helps clarify code to person reading it; use the # symbol
hist()
Creates a histogram
par()
Sets graphics parameters
par(mfrow)
Sets the mfrow graphics parameter to control the layout of subplots in a graph
barplot()
makes a bar graph
table()
Tabulates counts of categorical data
subset()
Selects subset of vectors, matrices, or dataframes that meet certain consitions
prop.table()
Tabulates proportion of occurrence of categorical data
data.frame()
Creates a data frame
boxplot(y ~ x)
Make a boxplot of the distribution of the numerical variable y, grouped by the levels of the categorical variable, x
tapply (y, x, FUN=f)
Split the data y into subsets according to the grouping x variables, computes summary statistics f for each
View()
Views a data frame in the script window
mean()
Calculates the average for a numerical vector
median()
Calculates the median for a numerical vector
sd()
Calculates the standard deviation for a numerical vector
plot(x,y)
plots a graph, where x is the independent variable and y is the dependent variable. If you don’t specify the type, it only plots points
For plot(x,y), type = “l”
gives line graph without showing dots
For plot(x,y), type = “o”
gives line graph with both showing dots and lines
table()
Creates a table of counts
prop.table()
Creates a table of proportions
dbinom()
Calculates a binomial probability
pbinom()
Calculates a cumulative binomial probability
round(,)
Rounds the values in its first argument to the specified number of decimal places (default 0)
chisq.test()
Performs a chi square test
spineplot()
Creates a mosaic plot
t()
Transposes a matrix
dpois(count, lambda)
Density value for the Poisson distribution with mean
pchisq(q,df)
Cumulative distribution dunction for the chi-squared distribution with df degrees of freedom
sum(x)
Computes the sum of all the values present in its argument x
qchisq(p,df)
Quantile function for the chi-squared distribution with df degrees of freedom