# Installing a package#install.packages("tidyverse")# Loading a packagelibrary(tidyverse)
โโ Attaching core tidyverse packages โโโโโโโโโโโโโโโโโโโโโโโโ tidyverse 2.0.0 โโ
โ dplyr 1.1.4 โ readr 2.1.5
โ forcats 1.0.0 โ stringr 1.5.1
โ ggplot2 3.5.2 โ tibble 3.3.0
โ lubridate 1.9.4 โ tidyr 1.3.1
โ purrr 1.0.4
โโ Conflicts โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ tidyverse_conflicts() โโ
โ dplyr::filter() masks stats::filter()
โ dplyr::lag() masks stats::lag()
โน Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Installed only once, but loaded each time you start R.
2. ๐ Importing Data
๐น Import CSV
data <-read.csv("data.csv")# Using readr (part of tidyverse)library(readr)data <-read_csv("data.csv")
Rows: 4 Columns: 4
โโ Column specification โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Delimiter: ","
chr (2): name, department
dbl (2): age, score
โน Use `spec()` to retrieve the full column specification for this data.
โน Specify the column types or set `show_col_types = FALSE` to quiet this message.