Description Usage Arguments Value Examples
Add a scatter plot to a chronicle report
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | add_scatterplot(
  report = "",
  dt,
  x,
  y,
  groups = NULL,
  faceted = NULL,
  scales = NULL,
  show_trend = NULL,
  trend_method = NULL,
  ggtheme = NULL,
  x_axis_label = NULL,
  y_axis_label = NULL,
  plot_palette = NULL,
  plot_palette_generator = NULL,
  scatterplot_title = NULL,
  title_level = 2,
  echo = FALSE,
  message = FALSE,
  warning = FALSE,
  fig_width = NULL,
  fig_height = NULL
)
 | 
| report | Character string containing all the R Markdown chunks previously added. Default is ”, an empty report. | 
| dt | data.frame containing the data to plot. | 
| x | Value on the x axis. | 
| y | Value on the y axis. | 
| groups | Name of the column containing the different groups. | 
| faceted | If TRUE (default), each group will be plotted separately. | 
| scales | From ggplot2::facet_wrap: Should scales be 'fixed', 'free', or free in one dimension ('free_x', 'free_y'). Default is 'fixed'. | 
| show_trend | If TRUE, adds a ggplot2::geom_smooth() line to the plot. Default is FALSE. | 
| trend_method | The method ggplot2::geom_smooth will use. Default is 'loess', which is a local polynomial regression fit | 
| ggtheme | ggplot2 theme function to apply. Default is ggplot2::theme_minimal. | 
| x_axis_label | Label for the x axis. | 
| y_axis_label | Label for the y axis. | 
| plot_palette | Character vector of hex codes specifying the colors to use on the plot. | 
| plot_palette_generator | Palette from the viridis package, used in case plot_palette is unspecified or insufficient for the number of colors required. | 
| scatterplot_title | Title of the scatter plot section on the report. If NULL, chronicle will try to parse a generic title using make_title() | 
| title_level | Level of the section title of this plot (ie, number of # on Rmarkdown syntax.) | 
| echo | Whether to display the source code in the output document. Default is FALSE. | 
| message | Whether to preserve messages on rendering. Default is FALSE. | 
| warning | Whether to preserve warnings on rendering. Default is FALSE. | 
| fig_width | Width of the plot (in inches). | 
| fig_height | Height of the plot (in inches). | 
An R Markdown file as a character string, now containing a chunk for the specified scatter plot.
| 1 2 3 4 5 6 7 | html_report <- add_scatterplot(report = "",
                            dt = ggplot2::mpg,
                            x = 'hwy',
                            y = 'cty',
                            groups = 'manufacturer',
                            faceted = FALSE)
cat(html_report)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.