From 8b8923fcb780a0cff374e11c457c2a65c9bb26b0 Mon Sep 17 00:00:00 2001 From: Stefan Fleck Date: Sat, 29 Sep 2018 09:50:52 +0200 Subject: [PATCH] spellcheck --- R/date_yq.R | 4 ++-- R/date_yw.R | 2 +- R/extract.r | 2 +- R/format.R | 4 ++-- R/predicates.R | 4 ++-- man/Summary.date_xx.Rd | 9 +++++++-- man/date_yq.Rd | 4 ++-- man/date_yw.Rd | 2 +- man/extract_date_xx.Rd | 2 +- man/format_date_xx.Rd | 2 +- man/format_ym.Rd | 4 ++-- man/is_quarter_bounds.Rd | 4 ++-- tests/testthat/test_date_yq.R | 2 +- 13 files changed, 25 insertions(+), 20 deletions(-) diff --git a/R/date_yq.R b/R/date_yq.R index 8ae2862..d516414 100644 --- a/R/date_yq.R +++ b/R/date_yq.R @@ -3,8 +3,8 @@ #' A Simple S3-Class for Year-Quarter Dates #' #' A simple data type for storing year-quarter dates in a human readable integer -#' format, e.g.: 3.Quarter of 2012 is stored as 20123. Supports simple arithmetics -#' (`+` and `-`) as well formatting. +#' format, e.g.: 3.Quarter of 2012 is stored as 20123. Supports simple +#' arithmetic operations such as `+` and `-` as well formatting. #' #' @param y year #' @param q quarter (optional) diff --git a/R/date_yw.R b/R/date_yw.R index 672725a..46f5745 100644 --- a/R/date_yw.R +++ b/R/date_yw.R @@ -4,7 +4,7 @@ #' #' A simple data type for storing year-isoweek dates in a human readable integer #' format, e.g.: the 52nd isoweek of 2012 is stored as 201252. Supports simple -#' arithmetics (`+` and `-`) as well formatting. +#' arithmetic operations such as `+` and `-` as well formatting. #' #' @param y year #' @param w week (optional) diff --git a/R/extract.r b/R/extract.r index e974fb7..9aca564 100644 --- a/R/extract.r +++ b/R/extract.r @@ -1,6 +1,6 @@ #' Extract or Replace Elements of a date_xx #' -#' Works exactly like susbetting base vectors via `[`, but preserves the +#' Works exactly like subsetting base vectors via `[`, but preserves the #' `date_xx` class and subclasses. The replacement functions `[<-` and `[[<-` #' conduct additional checks before assignment to prevent the generation of #' degenerate date_xx vectors (see examples). diff --git a/R/format.R b/R/format.R index 7d195dd..8f2cfdd 100644 --- a/R/format.R +++ b/R/format.R @@ -16,7 +16,7 @@ #' @param month_names,month_abb a `character` vector of length 12: Names and #' abbreviations for months that will be used for the #' placeholders `"%b"` and `"%B"`. Defaults to the values for -#' the current locale for compatbilioty with [base::strptime()]. +#' the current locale for compatibility with [base::strptime()]. #' @param ... ignored #' #' @@ -261,7 +261,7 @@ format_yq <- function(x, q = NULL, format = "%Y-Q%q"){ -#' Coerce and Format to Year-Muarter Strings +#' Coerce and Format to Year-Month Strings #' #' @param x,m Two integer (vectors). `m` is optional and the interpretation of #' `x` will depend on whether `m` is supplied or not: diff --git a/R/predicates.R b/R/predicates.R index 8106ffc..6b5f7ba 100644 --- a/R/predicates.R +++ b/R/predicates.R @@ -1,8 +1,8 @@ #' Test for Quarter Bounds #' -#' `is_first_of_quarter()` and `is_last_of_quarter()` check wheter a +#' `is_first_of_quarter()` and `is_last_of_quarter()` check whether a #' `Date` is the first or respectively the last day of an (arbitrary) quarter. -#' `is_quarter_bounds()` checks wheter two `Date` vectors mark the bounds of +#' `is_quarter_bounds()` checks whether two `Date` vectors mark the bounds of #' single quarters #' #' @param x,first,last `Date` vectors diff --git a/man/Summary.date_xx.Rd b/man/Summary.date_xx.Rd index 9554228..e53dddf 100644 --- a/man/Summary.date_xx.Rd +++ b/man/Summary.date_xx.Rd @@ -7,8 +7,7 @@ \method{Summary}{date_xx}(..., na.rm) } \arguments{ -\item{...}{\code{date_xx} vectors. It is up to the user to ensure that they are -of the same subclass.} +\item{...}{\code{date_xx} vectors with the same subclass} \item{na.rm}{logical: should missing values be removed?} } @@ -19,3 +18,9 @@ input, for range a vector of length 2 \description{ Maxima and Minima for date_xx } +\examples{ +min(date_yq(2014, 1), date_yq(2014, 2)) + +# raises an error +try(min(date_yq(2014, 1), date_ym(2014, 2))) +} diff --git a/man/date_yq.Rd b/man/date_yq.Rd index 03d96f4..f8065ee 100644 --- a/man/date_yq.Rd +++ b/man/date_yq.Rd @@ -29,8 +29,8 @@ argument is of type \code{date_yq} or not. } \description{ A simple data type for storing year-quarter dates in a human readable integer -format, e.g.: 3.Quarter of 2012 is stored as 20123. Supports simple arithmetics -(\code{+} and \code{-}) as well formatting. +format, e.g.: 3.Quarter of 2012 is stored as 20123. Supports simple +arithmetic operations such as \code{+} and \code{-} as well formatting. } \examples{ date_yq(2013, 3) diff --git a/man/date_yw.Rd b/man/date_yw.Rd index d9d26e5..661a019 100644 --- a/man/date_yw.Rd +++ b/man/date_yw.Rd @@ -30,7 +30,7 @@ argument is of type \code{date_yw} or not. \description{ A simple data type for storing year-isoweek dates in a human readable integer format, e.g.: the 52nd isoweek of 2012 is stored as 201252. Supports simple -arithmetics (\code{+} and \code{-}) as well formatting. +arithmetic operations such as \code{+} and \code{-} as well formatting. } \examples{ date_yw(2013, 12) diff --git a/man/extract_date_xx.Rd b/man/extract_date_xx.Rd index 525b098..5bee08c 100644 --- a/man/extract_date_xx.Rd +++ b/man/extract_date_xx.Rd @@ -63,7 +63,7 @@ correspond to the internal representation \code{date_yq/date_ym/date_yw} objects a \code{date_xx} vector } \description{ -Works exactly like susbetting base vectors via \code{[}, but preserves the +Works exactly like subsetting base vectors via \code{[}, but preserves the \code{date_xx} class and subclasses. The replacement functions \code{[<-} and \code{[[<-} conduct additional checks before assignment to prevent the generation of degenerate date_xx vectors (see examples). diff --git a/man/format_date_xx.Rd b/man/format_date_xx.Rd index 6e997dd..aede6ee 100644 --- a/man/format_date_xx.Rd +++ b/man/format_date_xx.Rd @@ -67,7 +67,7 @@ Literal \% can be escaped with \code{"\%\%"} (as in \code{\link[base:sprintf]{ba \item{month_names, month_abb}{a \code{character} vector of length 12: Names and abbreviations for months that will be used for the placeholders \code{"\%b"} and \code{"\%B"}. Defaults to the values for -the current locale for compatbilioty with \code{\link[base:strptime]{base::strptime()}}.} +the current locale for compatibility with \code{\link[base:strptime]{base::strptime()}}.} } \value{ a \code{character} vector diff --git a/man/format_ym.Rd b/man/format_ym.Rd index fae9da5..6cee310 100644 --- a/man/format_ym.Rd +++ b/man/format_ym.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/format.R \name{format_ym} \alias{format_ym} -\title{Coerce and Format to Year-Muarter Strings} +\title{Coerce and Format to Year-Month Strings} \usage{ format_ym(x, m = NULL, format = "\%Y-M\%m") } @@ -32,7 +32,7 @@ Literal \% can be escaped with \code{"\%\%"} (as in \code{\link[base:sprintf]{ba a \code{character} vector } \description{ -Coerce and Format to Year-Muarter Strings +Coerce and Format to Year-Month Strings } \section{Formatting shorthands}{ diff --git a/man/is_quarter_bounds.Rd b/man/is_quarter_bounds.Rd index 3bb1f61..4c6bf94 100644 --- a/man/is_quarter_bounds.Rd +++ b/man/is_quarter_bounds.Rd @@ -22,9 +22,9 @@ is_Date(x) a \code{logical} vector } \description{ -\code{is_first_of_quarter()} and \code{is_last_of_quarter()} check wheter a +\code{is_first_of_quarter()} and \code{is_last_of_quarter()} check whether a \code{Date} is the first or respectively the last day of an (arbitrary) quarter. -\code{is_quarter_bounds()} checks wheter two \code{Date} vectors mark the bounds of +\code{is_quarter_bounds()} checks whether two \code{Date} vectors mark the bounds of single quarters } \examples{ diff --git a/tests/testthat/test_date_yq.R b/tests/testthat/test_date_yq.R index 5d83f62..98e4ee3 100644 --- a/tests/testthat/test_date_yq.R +++ b/tests/testthat/test_date_yq.R @@ -45,7 +45,7 @@ test_that("as_date_yq works", { -test_that("as_date_yq arithmetics works", { +test_that("as_date_yq arithmetic works", { #* @testing increment.date_yq tdat <- (as_date_yq(c(-11, -12, -13, -14, 1, 2, 3, 4)))