View source: R/is.na.piar_index.R
is.na.piar_index | R Documentation |
Identify missing values in a price index.
## S3 method for class 'piar_index'
is.na(x)
## S3 method for class 'piar_index'
anyNA(x, recursive = FALSE)
x |
A price index, as made by, e.g., |
recursive |
Check if |
is.na()
returns a logical matrix, with a row for each level of x
and a
columns for each time period, that indicates which index values are missing.
anyNA()
returns TRUE
if any index values are missing, or percent-change
contributions (if recursive = TRUE
).
Other index methods:
[.piar_index()
,
aggregate.piar_index
,
as.data.frame.piar_index()
,
as.ts.piar_index()
,
chain()
,
contrib()
,
head.piar_index()
,
levels.piar_index()
,
mean.piar_index
,
merge.piar_index()
,
split.piar_index()
,
stack.piar_index()
,
time.piar_index()
,
window.piar_index()
index <- as_index(matrix(c(1, 2, 3, NA, 5, NA), 2))
anyNA(index)
is.na(index)
# Carry forward imputation
index[is.na(index)] <- 1
index
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.