Mastering intermediate data visualization in R with ggplot2 is essential for creating compelling visualizations. This chapter covers topics like customizing aesthetics, themes, layouts, and building advanced plots, such as facets and maps.
plot()ggplot()geom_plot()ggcreate()ggplot2tidyverseggthemesdata.tableadd_layer()plot_layer()geom_*()layer()colorplotaxisgraphaes()ggplot()data.frame()geom()aes() function do in ggplot2?
geom_point() in ggplot2?
color aestheticfill aestheticborder aestheticsize aestheticgeom_line()geom_smooth()geom_histogram()geom_boxplot()theme()theme_bw()set_theme()set_bg_color()xlab()axis_label()set_xlabel()label_x()theme_set()ggtheme()theme_*()set_theme()labs() function do in ggplot2?
theme() function and axis.title.size parameteraxis_size() functionggplot() function directlylabs() functioncolor aestheticline_color() functionline_aesthetic()plot_color()theme(legend.position = "none")remove_legend()no_legend()legend(FALSE)theme()margin()adjust_margin()plot_margin()scale_x_continuous() or scale_y_continuous()theme() functionaxis_ticks()set_ticks()theme()grid_lines()grid_custom()set_grid()facet_wrap()facet_grid()facet()facet_plot()facet_wrap() function do in ggplot2?
geom_map() and a map datasetgeom_polygon()geom_path()geom_area()geom_tile()geom_bar()geom_boxplot()geom_point()scale_*_continuous()geom_*() functionset_scale()continuous_scale()geom_sf()geom_map()geom_map_data()geom_location()theme(legend.position = ) argumentset_legend() functionlabs() functionlegend_location()ggtitle()theme() functionlabs()title()alpha aesthetictransparency()geom_transparent()opacity function| Qno | Answer |
|---|---|
| 1 | c) Data visualization |
| 2 | b) ggplot() |
| 3 | a) ggplot2 |
| 4 | c) geom_*() |
| 5 | a) color |
| 6 | b) ggplot() |
| 7 | b) Specifies aesthetic mappings |
| 8 | c) Scatter plot |
| 9 | a) color aesthetic |
| 10 | b) geom_smooth() |
| 11 | a) theme() |
| 12 | a) xlab() |
| 13 | c) theme_*() |
| 14 | b) Adds titles and labels to a plot |
| 15 | a) Using the theme() function and axis.title.size parameter |
| 16 | a) color aesthetic |
| 17 | a) theme(legend.position = "none") |
| 18 | a) theme() |
| 19 | a) Using scale_x_continuous() or scale_y_continuous() |
| 20 | a) theme() |
| 21 | a) To group data into subplots based on a variable |
| 22 | a) facet_wrap() |
| 23 | a) Creates a grid of subplots based on a categorical variable |
| 24 | a) By using geom_map() and a map dataset |
| 25 | a) geom_tile() |
| 26 | a) Using scale_*_continuous() |
| 27 | a) geom_sf() |
| 28 | a) By using the theme(legend.position = ) argument |
| 29 | a) Using ggtitle() |
| 30 | a) Using the alpha aesthetic |