R for Data Science

Published by onesixx on

http://r4ds.had.co.nz/      <- –  https://bookdown.org/

 

Garrett Grolemund, Hadley Wickham

http://tidyverse.org/
https://github.com/hadley/r4ds
http://style.tidyverse.org/

library(tidyverse)  로 tidyverse의  핵심 팩키지를 한번에 loading할수 있다. 

  • ggplot2, for data visualisation.
  • dplyr,      for data manipulation.
  • tidyr,      for data tidying.
  • readr,     for data import.
  • purrr,     for functional programming.
  • tibble,    for tibbles, a modern re-imagining of data frames
> library(tidyverse)
Loading tidyverse: ggplot2
Loading tidyverse: tibble
Loading tidyverse: tidyr
Loading tidyverse: readr
Loading tidyverse: purrr
Loading tidyverse: dplyr
Conflicts with tidy packages ------------------------
filter(): dplyr, stats
lag():    dplyr, stats
> tidyverse_conflicts()
Conflicts with tidy packages ------------------------------
filter(): dplyr, stats
lag():    dplyr, stats

 

> tidyverse_packages()
 [1] "broom"     "dplyr"     "forcats"   "ggplot2"   "haven"     "httr"      "hms"       "jsonlite" 
 [9] "lubridate" "magrittr"  "modelr"    "purrr"     "readr"     "readxl"    "stringr"   "tibble"   
[17] "rvest"     "tidyr"     "xml2"      "tidyverse"
> tidyverse_deps()
# A tibble: 19 × 4
     package    cran local behind
       <chr>   <chr> <chr>  <lgl>
1      broom   0.4.2 0.4.2  FALSE
2      dplyr   0.7.0 0.5.0   TRUE
3    forcats   0.2.0 0.2.0  FALSE
4    ggplot2   2.2.1 2.2.1  FALSE
5      haven   1.0.0 1.0.0  FALSE
6        hms     0.3   0.3  FALSE
7       httr   1.2.1 1.2.1  FALSE
8   jsonlite     1.5   1.4   TRUE
9  lubridate   1.6.0 1.6.0  FALSE
10  magrittr     1.5   1.5  FALSE
11    modelr   0.1.0 0.1.0  FALSE
12     purrr 0.2.2.2 0.2.2   TRUE
13     readr   1.1.1 1.1.1  FALSE
14    readxl   1.0.0 1.0.0  FALSE
15     rvest   0.3.2 0.3.2  FALSE
16   stringr   1.2.0 1.2.0  FALSE
17    tibble   1.3.3   1.2   TRUE
18     tidyr   0.6.3 0.6.1   TRUE
19      xml2   1.1.1 1.1.1  FALSE

 

 

Update

> tidyverse_update()
The following packages are out of date:
 * dplyr    (0.5.0 -> 0.7.0)
 * jsonlite (1.4 -> 1.5)
 * purrr    (0.2.2 -> 0.2.2.2)
 * tibble   (1.2 -> 1.3.3)
 * tidyr    (0.6.1 -> 0.6.3)
Update now?

1: Yes
2: No

Selection: 1
also installing the dependencies ‘bindr’, ‘bindrcpp’, ‘glue’, ‘pkgconfig’, ‘rlang’

 

  • Wrangle—transform your datasets into a form convenient for analysis
  • Program—learn powerful R tools for solving data problems with greater clarity and ease
  • Explore—examine your data, generate hypotheses, and quickly test them
  • Model—provide a low-dimensional summary that captures true “signals” in your dataset
  • Communicate—learn R Markdown for integrating prose, code, and results

 

Chapter 1 Data Visualization with ggplot2

  1. Introduction
  2. First Steps
  3. Aesthetic Mappings
  4. Common Problems
  5. Facets
  6. Geometric Objects
  7. Statistical Transformations
  8. Position Adjustments
  9. Coordinate Systems
  10. The Layered Grammar of Graphics

Chapter 2 Workflow: Basics

  1. Coding Basics
  2. What’s in a Name?
  3. Calling Functions

Chapter 3 Data Transformation with dplyr

  1. Introduction
  2. Filter Rows with filter()
  3. Arrange Rows with arrange()
  4. Select Columns with select()
  5. Add New Variables with mutate()
  6. Grouped Summaries with summarize()
  7. Grouped Mutates (and Filters)

Chapter 4 Workflow: Scripts

  1. Running Code
  2. RStudio Diagnostics

Chapter 5 Exploratory Data Analysis

  1. Intro
  2. Questions
  3. Variation
  4. Missing Values
  5. Covariation
  6. Patterns and Models
  7. ggplot2 Calls
  8. Learning More

Chapter 6 Workflow: Projects

  1. What Is Real?
  2. Where Does Your Analysis Live?
  3. Paths and Directories
  4. RStudio Projects
  5. Summary

 

Wrangle

Chapter 7 Tibbles with tibble

  1. Introduction
  2. Creating Tibbles
  3. Tibbles Versus data.frame
  4. Interacting with Older Code

Chapter 8 Data Import with readr

  1. Introduction
  2. Getting Started
  3. Parsing a Vector
  4. Parsing a File
  5. Writing to a File
  6. Other Types of Data

Chapter 9 Tidy Data with tidyr

  1. Introduction
  2. Tidy Data
  3. Spreading and Gathering
  4. Separating and Pull
  5. Missing Values
  6. Case Study
  7. Nontidy Data

Chapter 10 Relational Data with dplyr

  1. Introduction
  2. nycflights13
  3. Keys
  4. Mutating Joins
  5. Filtering Joins
  6. Join Problems
  7. Set Operations

Chapter 11 Strings with stringr

  1. Introduction
  2. String Basics
  3. Matching Patterns with Regular Expressions
  4. Tools
  5. Other Types of Pattern
  6. Other Uses of Regular Expressions
  7. stringi

Chapter 12 Factors with forcats

  1. Introduction
  2. Creating Factors
  3. General Social Survey
  4. Modifying Factor Order
  5. Modifying Factor Levels

Chapter 13 Dates and Times with lubridate

  1. Introduction
  2. Creating Date/Times
  3. Date-Time Components
  4. Time Spans
  5. Time Zones

 

 

Program

Chapter 14 Pipes with magrittr

  1. Introduction
  2. Piping Alternatives
  3. When Not to Use the Pipe
  4. Other Tools from magrittr

Chapter 15 Functions

  1. Introduction
  2. When Should You Write a Function?
  3. Functions Are for Humans and Computers
  4. Conditional Execution
  5. Function Arguments
  6. Return Values
  7. Environment

Chapter 16 Vectors

  1. Introduction
  2. Vector Basics
  3. Important Types of Atomic Vector
  4. Using Atomic Vectors
  5. Recursive Vectors (Lists)
  6. Attributes
  7. Augmented Vectors

Chapter 17 Iteration with purrr

  1. Introduction
  2. For Loops
  3. For Loop Variations
  4. For Loops Versus Functionals
  5. The Map Functions
  6. Dealing with Failure
  7. Mapping over Multiple Arguments
  8. Walk
  9. Other Patterns of For Loops

 

 

Model

Chapter 18 Model Basics with modelr

  1. Introduction
  2. A Simple Model
  3. Visualizing Models
  4. Formulas and Model Families
  5. Missing Values
  6. Other Model Families

Chapter 19 Model Building

  1. Introduction
  2. Why Are Low-Quality Diamonds More Expensive?
  3. What Affects the Number of Daily Flights?
  4. Learning More About Models

Chapter 20 Many Models with purrr and broom

  1. Introduction
  2. gapminder
  3. List-Columns
  4. Creating List-Columns
  5. Simplifying List-Columns
  6. Making Tidy Data with broom

 

Communicate

Chapter 21 R Markdown

  1. Introduction
  2. R Markdown Basics
  3. Text Formatting with Markdown
  4. Code Chunks
  5. Troubleshooting
  6. YAML Header
  7. Learning More

Chapter 22 Graphics for Communication with ggplot2

  1. Introduction
  2. Label
  3. Annotations
  4. Scales
  5. Zooming
  6. Themes
  7. Saving Your Plots
  8. Learning More

Chapter 23 R Markdown Formats

  1. Introduction
  2. Output Options
  3. Documents
  4. Notebooks
  5. Presentations
  6. Dashboards
  7. Interactivity
  8. Websites
  9. Other Formats
  10. Learning More

Chapter 24 R Markdown Workflow

 

 

 

Categories: R Tidyverse

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x