Section 4.8 Key Functions & Commands
The following functions and commands are introduced or reinforced in this chapter to support data restructuring, joining, and basic statistical comparison.
-
data.frame()(base R)-
Creates a data frame object for storing tabular data.
-
-
rbind()(base R)-
Combines multiple data frames by binding rows together.
-
-
merge()(base R)-
Joins two data frames together based on a shared key variable.
-
-
inner_join()(dplyr)-
Performs a SQL-style inner join, keeping only rows that match in both datasets.
-
-
pivot_longer()(tidyr)-
Converts data from wide format to long format.
-
-
pivot_wider()(tidyr)-
Converts data from long format back to wide format.
-
-
mean()(base R)-
Calculates the average value of a numeric variable.
-
-
t.test()(stats)-
Performs a hypothesis test to evaluate whether the means of two groups differ significantly.
-
