R Functions S&DS Exam One
Q: What does
abline()do?
A: Adds a straight line to a plot.Q: What does
abs()do?
A: Returns the absolute value of a number.Q: What does
apply()do?
A: Applies a function to rows or columns of a matrix or array.Q: What does
as.character()do?
A: Converts an object to a character (text) type.Q: What does
as.numeric()do?
A: Converts an object to a numeric type.Q: What does
as.vector()do?
A: Converts an object to a vector.Q: What does
attach()do?
A: Attaches a dataset to the search path, making its columns accessible by name.Q: What does
barplot()do?
A: Creates a bar chart.Q: What does
boot()do?
A: Performs bootstrapping (resampling) for statistical analysis.Q: What does
boot.ci()do?
A: Calculates confidence intervals for bootstrapped results.Q: What does
boxplot()do?
A: Creates a boxplot to visualize data distribution.Q: What does
by()do?
A: Applies a function to subsets of data based on a factor.Q: What does
c()do?
A: Combines values into a vector or list.Q: What does
calcTemp()do?
A: (Custom function) Likely calculates temperature-related values.Q: What does
cbind()do?
A: Combines columns into a matrix or data frame.Q: What does
cex()do?
A: Controls the size of text and symbols in plots.Q: What does
class()do?
A: Returns the class (type) of an object.Q: What does
cleanNHData()do?
A: (Custom function) Likely cleans or preprocesses NH (New Hampshire) data.Q: What does
colnames()do?
A: Gets or sets the column names of a matrix or data frame.Q: What does
colors()do?
A: Lists available color names in R.Q: What does
colSums()do?
A: Calculates the sum of each column in a matrix or data frame.Q: What does
complete.cases()do?
A: Identifies rows with no missing values.Q: What does
convertTimes()do?
A: (Custom function) Likely converts time formats.Q: What does
data.frame()do?
A: Creates a data frame (a table-like structure).Q: What does
dbinom()do?
A: Calculates the probability density for a binomial distribution.Q: What does
demo()do?
A: Runs demonstration scripts in R.Q: What does
dexp()do?
A: Calculates the probability density for an exponential distribution.Q: What does
dim()do?
A: Returns the dimensions (rows and columns) of a matrix or data frame.Q: What does
dirname()do?
A: Extracts the directory name from a file path.Q: What does
dnorm()do?
A: Calculates the probability density for a normal distribution.Q: What does
droplevels()do?
A: Removes unused levels from a factor.Q: What does
duplicated()do?
A: Identifies duplicate rows or elements.Q: What does
exp()do?
A: Calculates the exponential value of a number.Q: What does
factor()do?
A: Converts a vector into a factor (categorical variable).Q: What does
for()do?
A: Creates a loop to repeat a task multiple times.Q: What does
function()do?
A: Defines a custom function in R.Q: What does
getwd()do?
A: Returns the current working directory.Q: What does
glm()do?
A: Fits a generalized linear model.Q: What does
gsub()do?
A: Replaces text patterns in a string.Q: What does
head()do?
A: Displays the first few rows of a dataset.Q: What does
help()do?
A: Opens documentation for a function.Q: What does
hist()do?
A: Creates a histogram to show data distribution.Q: What does
hms()do?
A: (Custom function) Likely handles time in hours, minutes, and seconds.Q: What does
install.packages()do?
A: Installs R packages from CRAN.Q: What does
intersect()do?
A: Finds common elements between two vectors.Q: What does
is.na()do?
A: Checks for missing values (NA) in data.Q: What does
las()do?
A: Controls the orientation of axis labels in plots.Q: What does
legend()do?
A: Adds a legend to a plot.Q: What does
length()do?
A: Returns the number of elements in a vector or list.Q: What does
levels()do?
A: Gets or sets the levels of a factor.Q: What does
library()do?
A: Loads an R package.Q: What does
lines()do?
A: Adds lines to a plot.Q: What does
list()do?
A: Creates a list (a collection of objects).Q: What does
lm()do?
A: Fits a linear regression model.Q: What does
ln()do?
A: (Custom function) Likely calculates the natural logarithm.Q: What does
log()do?
A: Calculates the natural logarithm.Q: What does
log10()do?
A: Calculates the base-10 logarithm.Q: What does
ls()do?
A: Lists all objects in the current environment.Q: What does
matrix()do?
A: Creates a matrix.Q: What does
mean()do?
A: Calculates the average of a set of numbers.Q: What does
median()do?
A: Calculates the middle value of a set of numbers.Q: What does
merge()do?
A: Combines two datasets into one.Q: What does
mosaicplot()do?
A: Creates a mosaic plot for categorical data.Q: What does
ms()do?
A: (Custom function) Likely handles time in milliseconds.Q: What does
mtext()do?
A: Adds text to the margins of a plot.Q: What does
n()do?
A: (Custom function) Likely counts the number of rows or elements.Q: What does
N()do?
A: (Custom function) Likely counts the number of rows or elements.Q: What does
na.omit()do?
A: Removes rows with missing values.Q: What does
names()do?
A: Gets or sets the names of an object.Q: What does
nchar()do?
A: Returns the number of characters in a string.Q: What does
options()do?
A: Sets or retrieves global R options.Q: What does
par()do?
A: Sets graphical parameters for plots.Q: What does
paste()do?
A: Combines strings with a separator.Q: What does
paste0()do?
A: Combines strings without a separator.Q: What does
plot()do?
A: Creates a basic graph or scatter plot.Q: What does
points()do?
A: Adds points to a plot.Q: What does
Points()do?
A: (Custom function) Likely adds points to a plot.Q: What does
print()do?
A: Displays an object in the console.Q: What does
punctuation()do?
A: (Custom function) Likely handles punctuation in text.Q: What does
qq_plot()do?
A: (Custom function) Likely creates a Q-Q plot.Q: What does
qqline()do?
A: Adds a reference line to a Q-Q plot.Q: What does
qqnorm()do?
A: Creates a Q-Q plot for normality testing.Q: What does
qqPlot()do?
A: Creates a Q-Q plot with additional features.Q: What does
quantile()do?
A: Calculates quantiles of a dataset.Q: What does
range()do?
A: Returns the minimum and maximum values of a dataset.Q: What does
rbinom()do?
A: Generates random numbers from a binomial distribution.Q: What does
read.csv()do?
A: Reads data from a CSV file into R.Q: What does
read.data()do?
A: (Custom function) Likely reads data from a file.Q: What does
rep()do?
A: Repeats a value or vector multiple times.Q: What does
return()do?
A: Specifies the output of a function.Q: What does
rexp()do?
A: Generates random numbers from an exponential distribution.Q: What does
rm()do?
A: Removes objects from the environment.Q: What does
rnorm()do?
A: Generates random numbers from a normal distribution.Q: What does
round()do?
A: Rounds numbers to a specified number of decimal places.Q: What does
rownames()do?
A: Gets or sets the row names of a matrix or data frame.Q: What does
runif()do?
A: Generates random numbers from a uniform distribution.Q: What does
sample()do?
A: Randomly samples elements from a vector.Q: What does
sd()do?
A: Calculates the standard deviation of a dataset.Q: What does
seq()do?
A: Generates a sequence of numbers.Q: What does
set.seed()do?
A: Sets the random number generator seed for reproducibility.Q: What does
setwd()do?
A: Sets the working directory.Q: What does
sort()do?
A: Sorts a vector in ascending or descending order.Q: What does
sqrt()do?
A: Calculates the square root of a number.Q: What does
str()do?
A: Displays the structure of an object.Q: What does
subset()do?
A: Filters data based on conditions.Q: What does
substr()do?
A: Extracts a substring from a string.Q: What does
sum()do?
A: Calculates the sum of a set of numbers.Q: What does
summary()do?
A: Provides a summary of statistical measures for a dataset.Q: What does
t()do?
A: Transposes a matrix or data frame.Q: What does
t.test()do?
A: Performs a t-test to compare two groups.Q: What does
table()do?
A: Creates a frequency table for categorical data.Q: What does
tail()do?
A: Displays the last few rows of a dataset.Q: What does
text()do?
A: Adds text to a plot.Q: What does
tolower()do?
A: Converts text to lowercase.Q: What does
toTitleCase()do?
A: Converts text to title case.Q: What does
trimws()do?
A: Removes extra spaces from text.Q: What does
unique()do?
A: Returns unique values from a vector.Q: What does
var()do?
A: Calculates the variance of a dataset.Q: What does
which()do?
A: Returns the indices of elements that meet a condition.Q: What does
write.csv()do?
A: Writes data to a CSV file.