C_sample2Diff {solaR}R Documentation

Small utilities for difftime objects.

Description

diff2Hours converts a difftime object into its numeric value with units = 'hours'.

char2diff converts a character description into a difftime object, following the code of seq.POSIXt.

sample2Hours calculates the sampling time in hours described by a character or a difftime.

P2E (power to energy) sums a series of power values (for example, irradiance) to obtain energy aggregation (for example, irradiation) using sample2Hours for the units conversion.

Usage

diff2Hours(by)
char2diff(by)
sample2Hours(by)
P2E(x, by)

Arguments

by

A character for char2diff, sample2Hours and P2E, or a difftime for diff2Hours, sample2Hours and P2E.

x

A numeric vector.

Value

A numeric value or a difftime object.

Author(s)

Oscar Perpiñán Lamigueiro

See Also

Sol

Examples

char2diff('min')
char2diff('2 s')

sample2Hours('s')
sample2Hours('30 m')

by1 <- char2diff('10 min')
sample2Hours(by1)

[Package solaR version 0.46 Index]