🔷 Glossary

R Function Definition
? and help() help you to get more info on a specific function
View() command to open and manually inspect data in the viewer
across() apply the same function to several variables
add_index() build mean/sum index from variables
aes(x, y, fill, color, etc.) maps data to visual elements
arrange() arrange data in descending or ascending order
bow() introduce your scraping agent
case_when() transform existing variables based on multiple conditions
chrome_print() take automated screenshots
class() check what type of data an object contains
correlate() calculates the correlation between two metric variables
crosstab() tests the relationship between two categorical variables
describe() gives us specific descriptive statistics (e.g., mean, standard deviation)
describe_cat() gives us specific descriptive statistics (e.g., mode)
facet_wrap() splits a graph into separate panels
filter() filter specific observations, often based on conditions
geom_bar() creates a bar chart for counts or values
geom_boxplot() creates a box plot showing a distribution
geom_density() creates a smoothed curve of a numeric distribution
geom_line() creates a line graph connecting observations across x-values
geom_point() creates a scatter plot using points
get_reliability() get internal consistency for an index
ggplot() creating a graph
ggsave() saves graphs as image files
glimpse() inspect the structure of a dataset
group_by() groups a dataset based on a variable for subsequent analyses
head() show first rows of a dataset
html_attr() extract the value from a html attribute
html_element(), html_elements() extract the first (or all) matching HTML nodes from a scraped website
html_text() extract text from a html node
if_else() transform existing variables based on two conditions
install.packages() installs packages on your machine - only has to be run once
is.na() for every value in a variable, checks whether it contains missing data (TRUE) or not (FALSE)
kable() creates a table based on input data
labs() adds titles and labels to a graph
library() loads existing packages - has to be run everytime you reopen R Studio
mutate() create new variables
na_if() setting specific values to missing (NA)
ncol() get the number of columns for a dataset
nrow() get the number of rows for a dataset
read_csv(), read_csv2() read in tabular data (e.g., .csv file)
rename() rename variables
report() creates a report of descriptive statistics
save.image() saves your working directory
scrape() scrape a website
select() select specific variables
sum() creates sums for a variable
summarise() creates summary statistics for a dataset
t_test() calculates a t-test for differences in the mean across groups
tab_frequencies() gives us specific descriptive statistics (e.g., counts, percentages)
taskscheduler_create() schedule automated scraping runs with R
theme_minimal(), theme_classic(), theme_light() changes the design of your graph
|> the pipe, pushes data (left) through the pipe for transformation (right)