반응형 ggplot()1 (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. 이전 1 다음 반응형