data_coverage: data coverage

Description Usage Arguments Details Value Examples

View source: R/helpers.R

Description

helper for sfn_metrics

Usage

1
data_coverage(x, timestep, period_minutes)

Arguments

x

a vector, usually a variable in the sapflow or environmental data.

timestep

numeric value with the timestep in minutes

period_minutes

numeric value with the period in minutes

Details

This helper function calculates the coverage percentage in a vector, and is designed to be used inside a dplyr summarise statement. It calculates the coverage as the percentage of no NAs in the expected lenght of the summarising period stated by the timestep.

Value

a single value (numeric) with the percentage of coverage for that variable

Examples

1
2
3
# data for one day, 60 minutes timestep (24 values) with a 75% of coberture
x <- rep(c(1,2,3,NA), 6)
data_coverage(x, 60, 1440) # 75

sapfluxnetr documentation built on Aug. 28, 2020, 1:13 a.m.