raed_csv() write_csv() Table Data Wide form Long form pivot_longer() Nested form pivot_wider() Plot group_nest() unnest() {ggplot2} {patchwork} Image Files ggsave() Data Processing
data.frame *bble raed_csv() write_csv() Table Data Wide form Long form pivot_longer() Nested form pivot_wider() Plot group_nest() unnest() {ggplot2} {patchwork} Image Files ggsave() Data Processing
data.frame *bble raed_csv() write_csv() Table Data Wide form Long form pivot_longer() Nested form pivot_wider() Plot group_nest() unnest() {ggplot2} {patchwork} Image Files ggsave() Data Processing
Long form → Wide form data pivot_wider( data = df_long_1, values_from = value, names_from = name ) pivot_wider( data = df_long_2, values_from = c(x, y), names_from = tag )
data.frame / *bble raed_csv() write_csv() Table Data Wide form Long form pivot_longer() pivot_wider() Plot {ggplot2} Image Files ggsave() Data Processing
raed_csv() write_csv() Table Data Wide form Long form pivot_longer() pivot_wider() Plot {ggplot2} Image Files ggsave() Data Processing Long form Long form Long form Long form Long form Long form Long form Long form data.frame / *bble
It (dplyr) provides simple “verbs” to help you translate your thoughts into code. func?ons that correspond to the most common data manipula?on tasks Introduc6on to dplyr h"ps://cran.r-project.org/web/packages/dplyr/vigne"es/dplyr.html WFSCT {dplyr}
(SBNNBSPGEBUBNBOJQVMBUJPO By constraining your [email protected], it helps you think about your data [email protected] challenges. Introduc6on to dplyr hFps://cran.r-project.org/web/packages/dplyr/vigneFes/dplyr.html
1JQFBMHFCSB X %>% f X %>% f(y) X %>% f %>% g X %>% f(y, .) f(X) f(X, y) g(f(X)) f(y, X) %>% {magri7r} 「dplyr再⼊⾨(基本編)」[email protected] h"ps://speakerdeck.com/yutannihila6on/dplyrzai-ru-men-ji-ben-bian
Bring milk from the kitchen! Robot' <- lift(Robot, glass, table) Robot'' <- take(Robot', fridge, milk) Robot''' <- pour(Robot'', milk, glass) result <- put(Robot''', glass, table) result <- Robot %>% lift(glass, table) %>% take(fridge, milk) %>% pour(milk, glass) %>% put(glass, table) by using pipe, # ① # ② # ③ # ④ # ① # ② # ③ # ④
The =dyverse style guides h"ps://style.;dyverse.org/syntax.html#object-names "There are only two hard things in Computer Science: cache invalida:on and naming things"
Bring milk from the kitchen! Robot' <- lift(Robot, glass, table) Robot'' <- take(Robot', fridge, milk) Robot''' <- pour(Robot'', milk, glass) result <- put(Robot''', glass, table) result <- Robot %>% lift(glass, table) %>% take(fridge, milk) %>% pour(milk, glass) %>% put(glass, table) by using pipe, # ① # ② # ③ # ④ # ① # ② # ③ # ④
1JQFBMHFCSB X %>% f X %>% f(y) X %>% f %>% g X %>% f(y, .) f(X) f(X, y) g(f(X)) f(y, X) %>% {magri7r} 「dplyr再⼊⾨(基本編)」[email protected] h"ps://speakerdeck.com/yutannihila6on/dplyrzai-ru-men-ji-ben-bian
より多くの制約を課す事で、 魂の⾜枷から、より⾃由になる。 Igor Stravinsky И@горь Ф Страви́нский The more constraints one imposes, the more one frees one's self of the chains that shackle the spirit. 1882 - 1971 ※ 割と意訳
import Tidy Transform Visualize Model Communicate Modified from “R for Data Science”, H. Wickham, 2017 preprocessing Data science Data Observa=on Hypothesis NarraFve of data feedback Data processing
data.frame / *bble raed_csv() write_csv() Table Data Wide form Long form pivot_longer() pivot_wider() Plot {ggplot2} Image Files ggsave() Data Processing
raed_csv() write_csv() Table Data Wide form Long form pivot_longer() pivot_wider() Plot {ggplot2} Image Files ggsave() Data Processing Long form Long form Long form Long form Long form Long form Long form Long form data.frame / *bble
It (dplyr) provides simple “verbs” to help you translate your thoughts into code. func?ons that correspond to the most common data manipula?on tasks Introduc6on to dplyr h"ps://cran.r-project.org/web/packages/dplyr/vigne"es/dplyr.html WFSCT {dplyr}