hyet_fill: Fill a hyetograph with missing date values

Description Usage Arguments Value Examples

Description

hyet_fill fills missing date values in a hyetograph with NA values. Returns an error if hyet is not a valid hyetograph or time_step is a not a numeric value.

Usage

1
hyet_fill(hyet, time_step)

Arguments

hyet

a hyetograph from hyet_create function

time_step

hyetograph's time-step in minutes

Value

a tibble with the variables date and prec

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# create date and precipitation values using 5 minutes time-step
prec_date <- seq(from = as.POSIXct(0, origin = "2018-01-01"),
                  length.out =  100,
                  by = "5 mins")
set.seed(1)
prec_values <-round(runif(100,0,10),1)

# create hyetograph
hyet <- hyet_create(prec_date, prec_values)

# remove some random values from hyetograph
hyet_miss <- hyet[-sample(100,30), ]

# fill hyetograph
hyet_fill(hyet_miss, 5)

kvantas/erosivity documentation built on May 26, 2019, 5:42 p.m.