Skip to contents

[Experimental]

Usage

scatterPlot(
  result,
  x,
  y,
  line,
  point,
  ribbon,
  ymin = NULL,
  ymax = NULL,
  facet = NULL,
  colour = NULL,
  group = colour,
  label = character()
)

Arguments

result

A <summarised_result> object.

x

Column or estimate name that is used as x variable.

y

Column or estimate name that is used as y variable

line

Whether to plot a line using geom_line.

point

Whether to plot points using geom_point.

ribbon

Whether to plot a ribbon using geom_ribbon.

ymin

Lower limit of error bars, if provided is plot using geom_errorbar.

ymax

Upper limit of error bars, if provided is plot using geom_errorbar.

facet

Variables to facet by, a formula can be provided to specify which variables should be used as rows and which ones as columns.

colour

Columns to use to determine the colors.

group

Columns to use to determine the group.

label

Character vector with the columns to display interactively in plotly.

Value

A plot object.

Examples

# \donttest{
result <- mockSummarisedResult() |>
  dplyr::filter(variable_name == "age")

scatterPlot(
  result = result,
  x = "cohort_name",
  y = "mean",
  line = TRUE,
  point = TRUE,
  ribbon = FALSE,
  facet = age_group ~ sex)
#> `geom_line()`: Each group consists of only one observation.
#>  Do you need to adjust the group aesthetic?
#> `geom_line()`: Each group consists of only one observation.
#>  Do you need to adjust the group aesthetic?
#> `geom_line()`: Each group consists of only one observation.
#>  Do you need to adjust the group aesthetic?
#> `geom_line()`: Each group consists of only one observation.
#>  Do you need to adjust the group aesthetic?
#> `geom_line()`: Each group consists of only one observation.
#>  Do you need to adjust the group aesthetic?
#> `geom_line()`: Each group consists of only one observation.
#>  Do you need to adjust the group aesthetic?
#> `geom_line()`: Each group consists of only one observation.
#>  Do you need to adjust the group aesthetic?
#> `geom_line()`: Each group consists of only one observation.
#>  Do you need to adjust the group aesthetic?
#> `geom_line()`: Each group consists of only one observation.
#>  Do you need to adjust the group aesthetic?

# }