generateaWhereHistogram: generateaWhereHistogram

Description Usage Arguments Details Value Examples

View source: R/generateaWhereHistogram.R

Description

generateaWhereHistogram Generate a histogram of 1-2 weather variables with standardized formatting.

Usage

1
2
3
4
5
6
7
8
generateaWhereHistogram(
  data,
  variable,
  compare = FALSE,
  compare_var = NULL,
  xlabel = NULL,
  title = NULL
)

Arguments

data

data frame containing multiple observations - observations can be across time or locations (required)

variable

character string denoting the column name (from data) to chart. (required)

compare

logical, if set to TRUE function will chart a second variable, defined by the parameter compare_var. Default set to FALSE. (optional)

compare_var

character string denoting the column name of the second variable to chart (optional)

xlabel

character string denoting the label to give to the x axis of the chart (optional)

title

character string denoting the title to assign to the plot - default is the date span of data (optional)

Details

This function generates a histogram with standardized formatting in ggplot's gray theme. This function was created to work with the large datasets covering entire regions transferred by aWhere to clients, enabling them to examine variation in the current conditions of a region for any variable, as well as compare current vs. long-term normals. Technically, however, the function can work with any dataset, since unlike with the generateaWhereChart and generateaWhereStdDevChart functions, the input variable names are not restricted.

Value

plot object

Examples

1
2
3
4
5
6
7
## Not run: generateaWhereHistogram(data = weather_df
                                 ,variable = "precipitation.amount"
                                 ,compare = TRUE
                                 ,compare_var = "precipitation.average"
                                 ,xlabel = "mm"
                                 ,title = "Current vs. LTN Rain across region X, past 30 days")
## End(Not run)

aWhereAPI/aWhere-R-Charts documentation built on Dec. 30, 2021, 12:58 p.m.