|
1 | 1 | #' Plot a bar chart using ggplot2 |
2 | 2 | #' |
3 | | -#' @param data Data to plot |
4 | | -#' @param x x-axis data |
| 3 | +#' @param data Data to plot (all data types recognised by ggplot2::geom_bar() like data.frame) |
| 4 | +#' @param x x-axis data, must be a Date object |
5 | 5 | #' @param y y-axis data |
6 | | -#' @param breaks Break points |
| 6 | +#' @param breaks Break points, must be a sequence of dates |
7 | 7 | #' @param x_label x-axis label |
8 | 8 | #' @param y_label y-axis label |
9 | 9 | #' @param fill Fill colour |
@@ -47,10 +47,10 @@ plot_barchart <- function(data, x, y, breaks, x_label, y_label, fill = "pink", c |
47 | 47 |
|
48 | 48 | #' Plot a boxplot using ggplot2 |
49 | 49 | #' |
50 | | -#' @param data Data to plot |
51 | | -#' @param x x-axis data |
| 50 | +#' @param data Data to plot (all data types recognised by ggplot2::geom_boxplot() like data.frame) |
| 51 | +#' @param x x-axis data, must be a Date object |
52 | 52 | #' @param y y-axis data |
53 | | -#' @param breaks Break points |
| 53 | +#' @param breaks Break points, must be a sequence of dates |
54 | 54 | #' @param x_label x-axis label |
55 | 55 | #' @param y_label y-axis label |
56 | 56 | #' |
@@ -82,19 +82,19 @@ plot_boxplot <- function(data, x, y, breaks, x_label, y_label) { |
82 | 82 |
|
83 | 83 | #' Plot timeseries data |
84 | 84 | #' |
85 | | -#' @param data Data to plot |
86 | | -#' @param x Name of column to plot on x-axis, should be datetime, will be converted to Dates using as.Date |
| 85 | +#' @param data Data to plot (data.frame with x-axis column a character convertible to Date) |
| 86 | +#' @param x Name of column to plot on x-axis |
87 | 87 | #' @param y Name of column to plot on y-axis |
88 | | -#' @param breaks Date break points |
| 88 | +#' @param breaks Date break points, must be a sequence of dates |
89 | 89 | #' @param x_label x-axis label |
90 | 90 | #' @param y_label y-axis label |
91 | 91 | #' @param title Figure title |
92 | 92 | #' @param line_width Line width |
93 | 93 | #' @param line_colour Line colour |
94 | 94 | #' @param horizontal_y y-intercept for horizontal line |
95 | 95 | #' @param vertical_x x-intercept for vertical line |
96 | | -#' @param x_lim Limits for x-axis continous scale, vector passed to scale_x_continuous |
97 | | -#' @param y_lim Limits for y-axis continuous scale, vector passed to scale_y_continous |
| 96 | +#' @param x_lim Limits for x-axis continuous scale, vector passed to scale_x_continuous |
| 97 | +#' @param y_lim Limits for y-axis continuous scale, vector passed to scale_y_continuous |
98 | 98 | #' |
99 | 99 | #' @return ggplot |
100 | 100 | #' @export |
@@ -172,12 +172,12 @@ plot_timeseries <- function(data, |
172 | 172 |
|
173 | 173 | #' Create a line plot with a confidence interval. |
174 | 174 | #' |
175 | | -#' @param data Data to plot |
176 | | -#' @param x x-axis data |
| 175 | +#' @param data Data to plot (all data types recognised by ggplot2::geom_line() like data.frame) |
| 176 | +#' @param x x-axis data, must be a Date object |
177 | 177 | #' @param y1 y1 line data - solid |
178 | 178 | #' @param y2 y2 line data - dashed |
179 | 179 | #' @param y3 y3 line data - dashed |
180 | | -#' @param breaks Breaks vector |
| 180 | +#' @param breaks Breaks vector, must be a sequence of dates |
181 | 181 | #' @param x_label x-axis label |
182 | 182 | #' @param y_label y-axis label |
183 | 183 | #' @param y1_colour Colour for y1 |
|
0 commit comments