juliandaycounter: Date and Time Conversion

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/juliandaycounter.R

Description

Conversion of character vectors numeric values for Julian day and hour.

Usage

1
2
3
4
juliandaycounter(x, format = "%d-%b-%y",
yr.start = 8, yr.end = 9, na.rm = FALSE)
hourcounter(x, with.min = TRUE,
with.sec = FALSE, na.rm = FALSE)

Arguments

x

a character vector.

format

data format as described on the help page of as.Date.

yr.start

start of year characters.

yr.end

start of year characters.

with.min

logical, is the input contain minutes?

with.sec

logical, is the input contain seconds?

na.rm

logical, should NA values removed?

Details

Date format for juliandaycounter is "dd-mmm-yy" with only the last two decimals of year (maximum sring length is 9), by default.

Time format for hourcounter is "hh:mm" (or "h:mm" if hour is <10), by default. 24 hour clock format is used. The formatting of <10 minutes should follow "hh:01" and not "hh:1". Time conversion is done by the times function in the chron package.

Value

A numeric vector in both cases. juliandaycounter returns number of Julian day since January 1 of the same year. hourcounter returns real values for hour of the day (fractions if not 0 minutes).

Note

This is not a general solution for data and time conversions. Pre 2000 year are not handled, because data collection of ABMI started later.

Author(s)

P\'eter S\'olymos, solymos@ualberta.ca

References

http://www.abmi.ca/

See Also

as.Date, times

Examples

1
2
3
4
5
6
7
8
9
data(abmi.data)
y <- abmi.data$birdcount$Field.Date
y <- unique(y)
y
juliandaycounter(y)
h <- abmi.data$birdcount$Start.of.Point.Count...24.hour.clock.
h <- h[sample(h, 100)]
h
hourcounter(h)

abmiOld documentation built on May 2, 2019, 5:54 p.m.