gfGapLength: Julendat function to identify gap lengths in measurement...

Description Usage Arguments Value Author(s) Examples

View source: R/gfGapLength.R

Description

This is a function taken from Julendat (see https://code.google.com/p/julendat/) to identify gap lengths in (eco-)climatological measurement series of a given parameter.

Usage

1
2
gfGapLength(data.dep, pos.na, gap.limit, end.datetime = Sys.Date(),
  units = "days", ...)

Arguments

data.dep

Object of class ki.data. See as.ki.data, gsod2ki for further information.

pos.na

Numeric. Indices of missing data points.

gap.limit

Numeric. Maximum length of a measurement gap. All gaps exceeding this threshold will not be considered.

end.datetime

Object of class Date, default is Sys.Date(). Not required for GSOD data processing.

units

Character. Measurement interval, typically "days" for GSOD data.

...

Additional arguments. Currently not in use.

Value

A list containing start, end, and length of each data gap.

Author(s)

Florian Detsch

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(dplyr)

data(gsodstations)
moshi <- filter(gsodstations, STATION.NAME == "MOSHI")

gsod_moshi <- dlGsodStations(usaf = moshi$USAF,
                             start_year = 1990, end_year = 1995,
                             dsn = paste0(getwd(), "/data/moshi/"),
                             unzip = TRUE)

# Conversion to KiLi SP1 `ki.data` object
ki_moshi <- gsod2ki(data = gsod_moshi,
                    prm_col = c("TEMP", "MIN", "MAX"),
                    df2ki = TRUE)

# Identify length per data gap
gfGapLength(data.dep = ki_moshi,
            pos.na = which(is.na(slot(ki_moshi, "Parameter")$TEMP)),
            gap.limit = 365,
            units = "days",
            end.datetime = Sys.Date())

environmentalinformatics-marburg/GSODTools documentation built on May 13, 2017, 6:09 p.m.