![]() G <- ggplot(midwest, aes( x=area, y=poptotal)) + geom_point() + geom_smooth( method= "lm") # set se=FALSE to turnoff confidence bands # Delete the points outside the limits Let’s initialize a basic ggplot based on the midwest dataset. The second noticeable feature is that you can keep enhancing the plot by adding more layers (and themes) to an existing plot created using the ggplot() function. All the data needed to make the plot is typically be contained within the dataframe supplied to the ggplot() itself or can be supplied to respective geoms. The main difference is that, unlike base graphics, ggplot works with dataframes and not individual vectors. The syntax for constructing ggplots could be puzzling if you are a beginner or work primarily with base graphics.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |