missInfo: missInfo

View source: R/missInfo.R

missInfoR Documentation

missInfo

Description

detect one station n_miss infomation for single meteorological element

Usage

missInfo(data, date, station, clipdata = FALSE, ...)

## Default S3 method:
missInfo(
  x,
  date,
  station = "S1",
  clipdata = FALSE,
  Info_detail = TRUE,
  Info_days = TRUE,
  collapse = ", "
)

## S3 method for class 'dtime'
missInfo(x, ...)

## S3 method for class 'matrix'
missInfo(
  mat,
  date = as.Date(rownames(mat)),
  site = colnames(mat),
  clipdata = FALSE,
  verbose = TRUE,
  .parallel = FALSE,
  ...
)

## S3 method for class 'data.frame'
missInfo(df, clipdata = FALSE, verbose = TRUE, .parallel = FALSE, ...)

## S3 method for class 'list'
missInfo(lst, clipdata = FALSE, verbose = TRUE, .parallel = FALSE, ...)

Arguments

date

corresponding date of x (support monthly or daily)

station

character

clipdata

If clipdata is true, NAs at head and tail will be trimed. And trimed data will be return.

...

ignored

x

one station meteorological one column matrix data. Rownames is daily time string

Info_detail

If true detail n_miss information will be return, else n_miss information is na.

Info_days

If true n_miss seg days will be return

collapse

missinfo info collapse

mat

matrix data with row dimemsion is date and col is stations

df

data.frame, with dimension of [n_date, 1+n_station], and the first column is date.

lst

list of dtime object

Details

If all(is.na(x)) is true, then return a dtime begin and end date is 1951-01-01

Examples

data('prcp')
time_day <- prcp$date
site <- colnames(prcp)[-1]
mat  <- as.matrix(prcp[, -1])
Info1 <- missInfo(mat, clipdata = TRUE, time_day, site, verbose = TRUE)
Info2 <- missInfo(prcp, clipdata = TRUE, time_day, site, verbose = TRUE)
all.equal(Info2, Info1)

kongdd/MissInfo documentation built on Jan. 14, 2024, 2:22 a.m.