R
-
-
-
PatternsR 2018. 8. 3. 14:37
Patterns Q. Could this pattern be due to coincidence(i.e., random chance)?Q. How can you describe the relationship implied by the pattern?Q. How strong is the relationship implied by the pattern?Q. What other variables might affect the relationship?Q. Does the relationship change if you look at individual subgroups of the data? [출처] R for Data Science, Hadley Wickham & Garrett Grolemund, O'REILL..
-
boxplot with tidyverse packageR 2018. 8. 3. 14:32
tidyverse 패키지에서 제공하는 함수를 이용하여 두 개의 양적 자료를 이용하여 집단별 상자그림을 다음과 같이 작성할 수 있다. install.packages("tidyverse") library(tidyverse) # 1. carat를 구간의 폭이 0.1를 갖는 상자그림 diamonds %>% ggplot2::ggplot(mapping = aes(x = carat, y = price)) + geom_boxplot(mapping = aes(group = cut_width(x = carat, width = 0.1))) # 2. carat에 대해 구간의 개수가 20개 되는 상자그림 diamonds %>% ggplot2::ggplot(mapping = aes(x = carat, y = price)) + g..
-
heatmap with tidyverse packageR 2018. 8. 3. 14:05
tidyverse 패키지를 이용하여 두 개의 질적 자료(범주형 자료)에 대한 heatmap를 다음과 같이 작성할 수 있다. install.packages("tidyverse")library(tidyverse)diamonds %>% dplyr::count(cut, color) %>% ggplot2::ggplot(mapping = aes(x = cut, y = color)) + geom_tile(mapping = aes(fill = n)) [출처] R for Data Science, Hadley Wickham & Garrett Grolemund, O'REILLY, p100~101