반응형 R71 stat_summary > msleep2%filter(!is.na(vore))> ggplot(data=msleep2,aes(x=vore,y=sleep_total))+geom_boxplot() 2020. 9. 9. (R) The way to interpret boxplot in R > var1= rnorm(60,5,3)> var1 [1] 5.72545365 6.46736004 9.05905214 3.81404717 [5] 4.14243244 6.22773545 4.22229999 -0.09668701 [9] 1.92385930 2.68091447 2.02079779 11.82006166[13] 6.30123986 6.82444436 5.16561901 5.65673597[17] 6.80099706 8.14009518 5.84585539 4.54134577[21] 7.05242009 1.82990254 6.48332813 11.63180405[25] 0.27728859 5.68270070 4.78730331 0.59477055[29] 7.00621227 8.11715012 3.197.. 2020. 9. 7. (R) comparing several kernal density curves >library(plyr) > birthwt$smoke birthwt$smoke table(birthwt$smoke) NO smoke smoke 115 74 > ggplot(data=birthwt,aes(x=bwt))+geom_histogram(fill="white",colour="black")+facet_grid(vars(smoke)) > birthwt$race birthwt$race table(birthwt$race) black others white 26 67 96 > ggplot(data=birthwt,aes(x=bwt))+geom_histogram(fill="white",colour="black")+facet_grid(vars(race)) This form is not appropriate fo.. 2020. 9. 4. (R) Histogram to Scale Histogram / Scale Histogram and Density curve/binwidth/adjust of geom_density() Scale Histogram>density curve: always above the horizontal x-axis. total area =1 histogram: 'counts' on the vertical y-axis the disadvantage of the histogram: disadvantage of highly depending on the number of observations. So it is not an appropriate method for comparing two histograms when the data that histograms express have a different numbers of observations. if you want to compare two grap.. 2020. 9. 4. 이전 1 ··· 5 6 7 8 9 10 11 ··· 18 다음 반응형