load tidyverse
1.the core packages included in tidycerse
1.ggplot2
2.dplyr
3.tidyr
4.readr
5.purrr
6.tibble
tibble never changes the type of the inputs(if the input type is strings,
it never converts strings to factors.),it also never changes the names of
variables and it never creates row.names().
***
the differences between data.frame and tibble
first:printing,when printing a tibble,it only shows the first ten rows and
all the columns that fit on one screen.
second:subsetting,[ always returns a tibble.if you wanna extract a single
column,you can use [[ or $.
third:unlike with base data frames,tibble does not automatically recycle
vectors to match length.if you have one vector that’s of length 10,
and another that’s of 3,then you wanna use the two vector to construct
a tibble,but R will return error.
unlike data frames,tibble don’t support arithmetic operations on all
columns.
7.stringr
8.forcats
12.import packages
1.readr,for reading flat files.
2.DBI,for relational databases.
3.haven,for SPSS,STAT,and SAS data.
4.httr,for web APIs.
5.readxl,for xls and xlsx sheets.
6.googlesheet4,for google sheets via the sheets API V4.
7.googledrive for google drive files.
8.rvest,for google drive files.
9.jsonlite,for JSON.
10.xml2 for XML.
3.wrangle
excluding tidyr and dplyr,there are five packages(including stringr and forcats)
which are desiged to work with specific types of data:
1.lubridate for dates and date-times.
2.hms for time-of-day values.
3.blob for storin blob(binary) data.
4.program
in additional to purrr,which provides very consisent and natural methods for
iteration on R objects,there are two additional tidyverse packages that help
with general programming challenges:
1.magrittr:provide pipe,%>%.it also provise a number of more specialised piping
operators(like %$% and %<>%).
2.glue provides an alternative to paste() that makes it easier to combine
data and strings.
5.model
Modeling with the tidyverse uses the collection of tidymodels packages, which
largely replace the modelr package used in R4DS. These packages provide a
comprehensive foundation for creating and using models of all types. Visit the
Getting Started guide or, for more detailed examples, go straight to the Learn page.