본문 바로가기
반응형

R71

(R) Alternatives to overlapped geom_point()/ continuous/ discrete /stat_bin2d()/stat_binhex()/position="jitter" When the density of the graph in a particular range is high, we cannot really figure out how dense it is, and how many dots are in the position. For a solution, we can set alpha and shape of the dots, but the solutions are not enough to solve the limitations. ggplot(data=diamonds,aes(x=x*y*z,y=price))+geom_point()> ggplot(data=diamonds,aes(x=x*y*z,y=price))+geom_point(alpha=0.1)> ggplot(data=dia.. 2020. 8. 31.
(R) scatter dot plot/ a variable with continuous colour/by continuous size/ the way to adjust legend of the filling plot As you can easily understand, the variables x and y on x and y-axis are well represented even if they are continuous. Then what about adding another continuous variable to the dot plot?You can make a dot plot with smoothly colored dots that express the new continuous variable. Also, You can make a dot plot with smoothly getting bigger dots that express another continuous variable. For this post,.. 2020. 8. 27.
(R) scatter dot plot/ distinguish by discrete colour/by shape/ by colour and shape/ by filling and vacant > ?USJudgeRatings> mean(USJudgeRatings$PREP)[1] 7.467442 > mean(USJudgeRatings$INTG)[1] 8.02093 > USJudgeRatings_%mutate(INTGR=ifelse(INTG>8.02,"HIGH","LOW"),PREPR=ifelse(PREP>7.46,"LONG","SHORT")) > ggplot(data=USJudgeRatings,aes(x=DILG,y=FAMI))+geom_point()> ggplot(data=USJudgeRatings,aes(x=DILG,y=FAMI))+geom_point(shape=3) > ggplot(data=USJudgeRatings_,aes(x=DILG,y=FAMI,colour=PREPR))+geom_po.. 2020. 8. 25.
(R)The way to make "Stacked Area Graph" / The way to switch the order of legend and stack/geom_area() > data_frame_1 View(data_frame_1) > ggplot(data=data_frame_1,aes(x=Year,y=Freshmen,fill=Sex))+geom_area() > ggplot(data=data_frame_1,aes(x=factor(Year),y=Freshmen,fill=Sex,group=Sex))+geom_area() elements of Year in the graph is 2007.5, 2010.0 ... difficult to decode the graph. elements of factor(Year) in the graph is 2008,2010,2012,2014,2016,2018,2020 > data_frame_2View(data_frame_2) > ggplot(d.. 2020. 8. 24.
반응형