2/13/2023 0 Comments Alternative to stage plot pro![]() Head(dfm) # name wt mpg mpg_z mpg_grp cyl In the R code below, we’ll plot the mpg z-score from the mtcars data set.Ĭalculate the z-score of the mpg data: # Calculate the z-score of the mpg dataĭfm$mpg_z <- (dfm$mpg -mean(dfm$mpg))/sd(dfm$mpg)ĭfm$mpg_grp <- factor(ifelse(dfm$mpg_z < 0, "low", "high"), The deviation graph shows the deviation of quantitative values to a reference value. Sort.val = "asc", # Sort the value in dscending order X.text.angle = 90 # Rotate vertically x axis texts groups = FALSE, # Don't sort inside each group Sort.val = "desc", # Sort the value in dscending order Palette = "jco", # jco journal color palett. ggbarplot(dfm, x = "name", y = "mpg",Ĭolor = "white", # Set bar border colors to white Sorting will be done globally, but not by groups. Change the fill color by the grouping variable “cyl”. ![]() # Hornet Sportabout Hornet Sportabout 3.44 18.7 8Ĭreate ordered bar plots. # Hornet 4 Drive Hornet 4 Drive 3.21 21.4 6 ![]() # Mazda RX4 Wag Mazda RX4 Wag 2.88 21.0 6 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |