![]() ![]() # scatterplot + trendline: linear ggplot(radon_summary, aes(D, mean)) + geom_point( size = 2) + geom_errorbar( aes( ymin=mean -sd, ymax=mean +sd), width = 0.05) + labs( x= "Diameter (mm)", y= "Radon Released (%)") + theme_bw() + theme( = element_blank(), = element_blank()) + geom_smooth( method = "lm", formula = y ~ x) + labs( subtitle= "Trendline: linear") # scatterplot + trendline: quadratic ggplot(radon_summary, aes(D, mean)) + geom_point( size = 2) + geom_errorbar( aes( ymin=mean -sd, ymax=mean +sd), width = 0.05) + labs( x= "Diameter (mm)", y= "Radon Released (%)") + theme_bw() + theme( = element_blank(), = element_blank()) + geom_smooth( method = "lm", formula = y ~ x + I(x ^ 2)) + labs( subtitle= "Trendline: quadratic") # scatterplot + trendline: exponential ggplot(radon_summary, aes(D, mean)) + geom_point( size = 2) + geom_errorbar( aes( ymin=mean -sd, ymax=mean +sd), width = 0.05) + labs( x= "Diameter (mm)", y= "Radon Released (%)") + theme_bw() + theme( = element_blank(), = element_blank()) + geom_smooth( method = "lm", formula = y ~ exp( -x)) + labs( subtitle= "Trendline: exponential")Ĭomparing the different plots, I will choose the one using the exponential trendline to go on with the examples. ![]() We are going to start by loading the appropriate libraries, the readr to load the data from a csv file, the ggplot2 for the plots. You can download the summarised table here, or you can go to the tutorial on One-Way ANOVA to see how to create it. ![]() We are going to use a table with summarised data: the shower diameter, the mean and standard deviation of the radon released, and compact letter display indicating the significant differences by Tukey’s test. The data was published in the Environment International Journal. Example: R df<-read.csv('bestsellers. Syntax: plot (x, y, main, xlab, ylab, xlim, ylim, axes) Let us first create a scatterplot without any color so that the difference is apparent. In this tutorial we are going to build scatterplots to show the results of a one-factor experiment that measured the release of radon in showers with different aperture diameters. Method 1: Using plot () The simple scatterplot is created using the plot () function. Adding compact letter display from Tukey’s test. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |