Skip to content

Commit

Permalink
Add examples and cross-refs to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
QSparks committed Oct 28, 2024
1 parent 7d026fc commit bb5d3c8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
18 changes: 18 additions & 0 deletions R/climdexGenericScalar.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ climdexGenericScalar.csv <- function(
#' @param calendar A string representing the calendar type, e.g., "gregorian".
#' @return A `ClimdexGenericScalar` object containing the processed data.
#'
#' @seealso [climdexGenericScalar.raw()], [climdexSingleMonthlyScalar.csv()]
#'
#' @examples
#' \dontrun{
#' data <- runif(12, 0, 20)
#' dates <- as.PCICt(seq(as.Date("2020-01-01"), by = "month", length.out = 12), cal = "gregorian")
#' scalar_obj <- climdexSingleMonthlyScalar.raw(data, dates)
#' }
#'
#' @export

climdexSingleMonthlyScalar.raw <- function(
Expand Down Expand Up @@ -197,6 +206,15 @@ climdexSingleMonthlyScalar.raw <- function(
#'
#' @return A `ClimdexGenericScalar` object containing the processed scalar climate data.
#'
#' @seealso [climdexSingleMonthlyScalar.raw()]
#'
#' @examples
#' \dontrun{
#' csv_file <- "path/to/scalar_data.csv"
#' scalar_obj <- climdexSingleMonthlyScalar.csv(file = csv_file, data.column = "data",
#' date.columns = "date", date.format = "%Y-%m-%d")
#' }
#'
#' @export

climdexSingleMonthlyScalar.csv <- function(
Expand Down
20 changes: 20 additions & 0 deletions R/climdexGenericVector.R
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ climdexGenericVector.csv <- function(
#' @param calendar String representing the calendar type, e.g., "gregorian".
#'
#' @return A `ClimdexGenericVector` object containing the processed vector data.
#'#'
#' @seealso [climdexGenericVector.raw()], [climdexSingleMonthlyVector.csv()]
#'
#' @examples
#' \dontrun{
#' primary <- runif(12, 0, 20)
#' secondary <- runif(12, 0, 360)
#' dates <- as.PCICt(seq(as.Date("2020-01-01"), by = "month", length.out = 12), cal = "gregorian")
#' vector_obj <- climdexSingleMonthlyVector.raw(primary, secondary, dates, "polar")
#' }
#'
#' @export

Expand Down Expand Up @@ -254,6 +264,16 @@ climdexSingleMonthlyVector.raw <- function(
#'
#' @return A `ClimdexGenericVector` object containing the processed vector climate data.
#'
#' @seealso [climdexSingleMonthlyVector.raw()]
#'
#' @examples
#' \dontrun{
#' csv_file <- "path/to/vector_data.csv"
#' vector_obj <- climdexSingleMonthlyVector.csv(file = csv_file, primary.column = "primary",
#' secondary.column = "secondary", date.columns = "date",
#' date.format = "%Y-%m-%d", format = "polar")
#' }
#'
#' @export

climdexSingleMonthlyVector.csv <- function(
Expand Down

0 comments on commit bb5d3c8

Please sign in to comment.