Small utilities for difftime objects.

Share:

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

1
2
3
4

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

1
2
3
4
5
6
7
8
char2diff('min')
char2diff('2 s')

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

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.