gfNogapLength: Julendat function to identify lengths of continuous...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/gfNogapLength.R

Description

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

Usage

1
gfNogapLength(gaps, data.dep, ...)

Arguments

gaps

A data.frame or list. Usually created from gfGapLength.

data.dep

An object of class ki.data, or a filepath that can be coerced to ki.data. The data set under investigation.

...

Additional arguments. Currently not in use.

Value

A list containing start, end, and length of each continuous measurement.

Author(s)

Florian Detsch

See Also

gfGapLength

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
gaps <- gfGapLength(data.dep = ki_moshi,
                    pos.na = which(is.na(slot(ki_moshi, "Parameter")$TEMP)),
                    gap.limit = 365,
                    units = "days",
                    end.datetime = Sys.Date())

# Identify lengths of continuous measurements
nogaps <- gfNogapLength(gaps = gaps,
                        data.dep = ki_moshi)

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