data_coverage: data coverage

View source: R/helpers.R

data_coverageR Documentation

data coverage

Description

helper for sfn_metrics

Usage

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 length of the summarising period stated by the timestep.

Value

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

Examples

# 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 Feb. 16, 2023, 7:52 p.m.