본문 바로가기
반응형

r16

(R) make a summary - group_by(),summarise() >library(ggplot2) ------------------for mpg>library(dplyr) ------------------for summarise() >mpg%>%summarise(mean_cty=mean(cty)) # A tibble: 1 x 1mean_cty 1 16.9 A summary of a group(drv) by mean_cty >drv_cty%group_by(drv)%>%summarise(mean_cty=mean(cty)) > drv_cty # A tibble: 3 x 2 drv mean_cty 1 4 14.32 f 20.03 r 14.1 A summary of groups of drv, manufacturer (4,f,r - Audi,Chevrolet, ...) by me.. 2020. 7. 22.
(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.
Interpret data frame/ summary(), typeof(), str(), class(),View(),names(),ncol(),length(),nrow(),dim() Interpreting the data frame > final_score student math science1 Jane 70 902 Dora 90 303 Beth 50 804 Park 100 100 > typeof(final_score) [1] "list" #list consists of 3 components which have 4 elements. #data frame is a kind of lists > class(final_score)[1] "data.frame" summary(), str() ----------------------identify data frame's structure > summary(final_score) student math science Length:4 Min. :.. 2020. 7. 16.
(R) data.frame function / Way to make data frame 데이터 프레임 만들기 R Way to make a data frame data fame is mostly used data structure which consists of columns(Variables) and rows(Cases)1st way to make a data frame > student class height height_of_students height_of_students student class height1 Jane 1 1532 Dora 3 1723 Beth 2 165 4 Park 2 180 'height_of_students' become the data frame which consists of 3 variables ('students,' 'class,' 'height') and 4 cases. 2nd.. 2020. 7. 16.
반응형