Getting started with R
Last updated
Last updated
tidyverse - this is actually a collection of packages that are helpful when cleaning and analyzing data, using "tidy" data philosophy.
ggplot2 - part of the tidyverse, this package lets you easily create beautiful, customizable plots and graphs in R. Each plot is executed with the ggplot()
function, and then you can add different "layers" or "geoms" with a +
before each line. .
janitor - this package is useful for its clean_names()
function, which applies "snake case" to all column names in a dataset. Snake case is a naming convention where all words are lower case and separated by an underscore: this_is_snake_case
here - this package and its function here() are useful for creating relational file paths. If you read in a data file on your specific computer read_csv("C://Hilary/data/data.csv")
, if you try to run that code on another computer, it will fail. The here package essentially places a marker file within your R project folder, so all file paths are related to that root folder where the marker is. The function builds the rest of the path based on whatever computer it is on. Reading in data would look like: read_csv(here("data/data.csv"))
. This is very helpful for collaboration, or working on a project sometimes at home and sometimes at the lab.
here()
-
pivot_longer
& pivot_wider
-
clean_names
-