1/85
Vocabulary flashcards summarizing essential R functions, statistical terms, and data-handling concepts from the lecture notes. Use them to review key commands, definitions, and ideas for the upcoming exam.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
mean()
R function that returns the arithmetic average of a numeric vector or column.
median()
R function that returns the middle value of a numeric vector or column.
sd()
R function that computes the standard deviation (spread around the mean).
IQR()
R function that calculates the inter-quartile range (Q3 – Q1).
range()
R function that returns a two-element vector of the minimum and maximum values.
quantile()
R function that finds a specified percentile; e.g., probs = 0.25 yields Q1.
min()
R function that retrieves the smallest value of a numeric vector.
max()
R function that retrieves the largest value of a numeric vector.
summary()
Returns six-number summary (min, Q1, median, mean, Q3, max) for a vector or each numeric column of a data frame.
weighted.mean()
Calculates the mean of values using a supplied vector of weights.
exp()
R function that evaluates the exponential function e^x.
log()
Computes the natural logarithm (ln) of its argument.
log10()
Computes the base-10 logarithm of its argument.
sqrt()
Returns the square root of numeric input.
abs()
Returns the absolute value of numeric input.
factorial()
Returns n! for each element of a numeric vector.
sum()
Adds up all elements of a numeric vector or column.
floor()
Rounds numeric values toward negative infinity (always down).
ceiling()
Rounds numeric values toward positive infinity (always up).
round()
Rounds to a specified number of digits; .5s go to the nearest even number.
table()
Base R function that creates a frequency or contingency table for categorical data.
data frame
Two-dimensional heterogeneous data structure with rows as observations and columns as variables.
tibble
Tidyverse’s modern re-imagining of a data frame that preserves column types and prints nicely.
observational unit
Individual entity on which data are recorded in an observational study.
experimental unit
Entity subjected to treatments in an experimental study.
variable
Recorded characteristic of observational/experimental units; can be quantitative or categorical.
quantitative variable
Takes numerical values for which arithmetic operations make sense.
categorical variable
Takes category labels (nominal or ordinal) rather than numeric magnitudes.
discrete variable
Quantitative variable whose possible values have gaps (often counts).
continuous variable
Quantitative variable that can take any value within an interval (no gaps).
ordinal variable
Categorical variable with an inherent order among categories.
nominal variable
Categorical variable whose categories have no natural order.
mean (concept)
Balancing point of a distribution—the arithmetic average.
median (concept)
Value that separates the lower 50 % and upper 50 % of data.
mode
Most frequently occurring observation in a dataset.
standard deviation
Average distance each observation is from the mean.
inter-quartile range (IQR)
Middle 50 % spread; difference between Q3 and Q1.
statistical range
Difference between maximum and minimum values: max – min.
frequency table
Displays counts of occurrences for each category of a categorical variable.
relative frequency table
Displays percentages instead of counts for each category.
contingency table
Cross-tabulation of counts for two (or more) categorical variables.
Basic arithmetic operators for addition, subtraction, multiplication, and division in R.
| & !
Logical OR, AND, and NOT operators in R.
^
Exponentiation (power) operator in R.
%>%
Pipe operator from magrittr/tidyverse that passes the result of one expression into the next.
setwd()
Sets the working directory to a specified file path.
getwd()
Returns the current working directory path.
read.csv()
Base R function to import a comma-separated file into a data frame.
read.table()
Base R import function with flexible delimiter via sep argument.
read.delim()
Reads tab-delimited text files into R (Base R).
read_csv()
readr function (tidyverse) for fast CSV import; automatically sets col_names = TRUE.
read_table()
readr function for whitespace-delimited files.
read_delim()
readr import function allowing any specified delimiter.
read_xls()
readxl function that imports legacy .xls Excel files.
read_xlsx()
readxl function that imports modern .xlsx Excel files.
write.csv()
Base R function to export data to a CSV file (adds row names by default).
write_csv()
readr function to export data to CSV without row names by default.
head()
Shows the first six rows (or n specified) of a data frame.
tail()
Shows the last six rows (or n specified) of a data frame.
glimpse()
Tidyverse function that previews a data frame’s structure horizontally.
View() / view()
Opens data in a spreadsheet-style tab in RStudio.
install.packages()
Downloads and installs an R package from CRAN.
library() / require()
Loads an installed package into the current R session.
package
Collection of R functions, data, and documentation that extends base R functionality.
working directory
Default folder R uses for reading and writing files during a session.
Any text following # is treated as a comment and ignored by R.
R script heading
Lines that start with one or more # and end with ----, ####, or ==== to create foldable headers.
numeric (double)
Default numeric class in R, stored with double-precision decimals.
integer
Whole-number class in R; created by appending L (e.g., 5L).
character
Class for text strings enclosed in quotes.
logical
TRUE/FALSE values resulting from Boolean expressions.
vector
One-dimensional collection of values of the same class; fundamental R object.
factor
Special class for categorical variables with fixed possible values (levels).
as.numeric()
Coerces an object to numeric if possible.
as.character()
Coerces an object to character strings.
length()
Returns the number of elements in a vector or the number of columns in a data frame.
nrow()
Returns the number of rows in a two-dimensional object.
ncol()
Returns the number of columns in a two-dimensional object.
dim()
Returns a two-element vector of rows and columns for 2D objects.
square brackets []
Primary indexing syntax: rows, columns for 2D objects or positions for vectors.
names()
Gets or sets names for elements in a vector or column names in data frames.
colnames()
Gets or sets column names specifically for matrices/data frames.
rownames()
Gets or sets row names for matrices/data frames.
indexing starts at 1
In R, the first element of any object has index 1, not 0.
factorial(value)
Returns value! (repeated multiplication down to 1).
factorial(vector)
Vectorized factorial; computes n! for each vector element.