diff --git a/DESCRIPTION b/DESCRIPTION index 240124a..547b27f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: piar Title: Price Index Aggregation -Version: 0.5.0.9030 +Version: 0.6.0 Authors@R: c( person("Steve", "Martin", role = c("aut", "cre", "cph"), email = "stevemartin041@gmail.com", diff --git a/R/aggregation_structure-class.R b/R/aggregation_structure-class.R index 8b0fe41..ee0fd9c 100644 --- a/R/aggregation_structure-class.R +++ b/R/aggregation_structure-class.R @@ -88,7 +88,7 @@ str.piar_aggregation_structure <- function(object, ...) { #' Test if an object is a price index aggregation structure #' -#' Test if an object is a price index aggregation structure +#' Test if an object is a price index aggregation structure. #' #' @param x An object to test. #' diff --git a/R/aggregation_structure.R b/R/aggregation_structure.R index 440dca1..bb3dc4c 100644 --- a/R/aggregation_structure.R +++ b/R/aggregation_structure.R @@ -16,8 +16,8 @@ #' elemental aggregate the same weight. #' #' @returns -#' A price index aggregation structure. This is an object of class -#' `piar_aggregation_structure`, which has the following components. +#' A price index aggregation structure of class `piar_aggregation_structure`. +#' This is a list-S3 class with the following components. #' #' \item{child}{A nested list that gives the positions of the immediate #' children for each node in each level of the aggregation structure above the diff --git a/R/expand_classification.R b/R/expand_classification.R index e5eb9fc..46168b8 100644 --- a/R/expand_classification.R +++ b/R/expand_classification.R @@ -52,7 +52,7 @@ paste_until <- function(x, i) { expand_classification <- function(x, width = 1L) { x <- as.character(x) width <- as.integer(width) - if (any(width <= 0)) { + if (any(width <= 0L)) { stop("'width' must be strictly positive") } if (anyNA(width)) { diff --git a/R/mean.piar_index.R b/R/mean.piar_index.R index 2d9504c..9395db3 100644 --- a/R/mean.piar_index.R +++ b/R/mean.piar_index.R @@ -54,7 +54,7 @@ #' #' @family index methods #' @export -mean.piar_index <- function(x, weights = NULL, window = 3, na.rm = FALSE, +mean.piar_index <- function(x, weights = NULL, window = 3L, na.rm = FALSE, r = 1, ...) { if (!is.null(weights)) { if (length(weights) != length(x$time) * length(x$levels)) { diff --git a/README.Rmd b/README.Rmd index 32cf308..0a09cd2 100644 --- a/README.Rmd +++ b/README.Rmd @@ -12,7 +12,7 @@ knitr::opts_chunk$set( ) ``` -# Price Index Aggregation in R piar website +# Price Index Aggregation in R piar website [![CRAN status](https://www.r-pkg.org/badges/version/piar)](https://cran.r-project.org/package=piar) diff --git a/README.md b/README.md index 4b95262..4724c8d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# Price Index Aggregation in R piar website +# Price Index Aggregation in R piar website diff --git a/man/aggregation_structure.Rd b/man/aggregation_structure.Rd index 9ffb9a5..318debd 100644 --- a/man/aggregation_structure.Rd +++ b/man/aggregation_structure.Rd @@ -20,8 +20,8 @@ aggregates (i.e., the last vector in \code{x}). The default is to give each elemental aggregate the same weight.} } \value{ -A price index aggregation structure. This is an object of class -\code{piar_aggregation_structure}, which has the following components. +A price index aggregation structure of class \code{piar_aggregation_structure}. +This is a list-S3 class with the following components. \item{child}{A nested list that gives the positions of the immediate children for each node in each level of the aggregation structure above the diff --git a/man/is_aggregation_structure.Rd b/man/is_aggregation_structure.Rd index df86a92..d5e3d76 100644 --- a/man/is_aggregation_structure.Rd +++ b/man/is_aggregation_structure.Rd @@ -13,5 +13,5 @@ is_aggregation_structure(x) Returns \code{TRUE} if \code{x} inherits from \code{\link{piar_aggregation_structure}} } \description{ -Test if an object is a price index aggregation structure +Test if an object is a price index aggregation structure. } diff --git a/man/mean.piar_index.Rd b/man/mean.piar_index.Rd index 1d813b8..31d4c6d 100644 --- a/man/mean.piar_index.Rd +++ b/man/mean.piar_index.Rd @@ -4,7 +4,7 @@ \alias{mean.piar_index} \title{Aggregate a price index over subperiods} \usage{ -\method{mean}{piar_index}(x, weights = NULL, window = 3, na.rm = FALSE, r = 1, ...) +\method{mean}{piar_index}(x, weights = NULL, window = 3L, na.rm = FALSE, r = 1, ...) } \arguments{ \item{x}{A price index, as made by, e.g., \code{\link[=elemental_index]{elemental_index()}}.}