data_coverage | R Documentation |
helper for sfn_metrics
data_coverage(x, timestep, period_minutes)
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 |
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.
a single value (numeric) with the percentage of coverage for that variable
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.