반응형 geom_col()2 (R) ifelse() ifelse() Using ifelse(), you can make a new variable based on the test you made. >library(ggplot2)> summary(diamonds$carat) -------------carat: size of carat in each diamond Min. 1st Qu. Median Mean 3rd Qu. Max. 0.2000 0.4000 0.7000 0.7979 1.0400 5.0100 To make a new variable 'carattt' which consists of small and big, I will use a test in ifelse() 1st test:diamonds$carat diamonds$carattt carattt.. 2020. 7. 23. (R) geom_col() VS geom_bar() This posting is about the difference between geom_col() and geom_bar() which look similar. geom_col() geom_bar() need both x-axis and y-axis designated only need x-axis or y-axis designated need summary about x and y only need raw material > library(ggplot2)> library(dplyr)> mpg2%group_by(manufacturer)%>%summarise(mean_hwy=mean(hwy)) # make summarise > ggplot(data=mpg2,aes(x=manufacturer,y=mean_.. 2020. 7. 20. 이전 1 다음 반응형