date2num: translate character dates to numeric dates

date2numR Documentation

translate character dates to numeric dates

Description

convert character dates to numeric dates (seconds since UNIX epoch by default).

Usage

date2num(d, tz = "UTC", ...)

## S4 method for signature 'sattagstream'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

## S4 method for signature 'all'
date2num(d, tz = "UTC", format = "%m/%d/%Y %H:%M:%S", ...)

## S4 method for signature 'behavior'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

## S4 method for signature 'corrupt'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

## S4 method for signature 'fastgps'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

## S4 method for signature 'rawargos'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

## S4 method for signature 'rtc'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

## S4 method for signature 'series'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

## S4 method for signature 'seriesrange'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

## S4 method for signature 'locations'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

## S4 method for signature 'status'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

## S4 method for signature 'summary'
date2num(d, tz = "UTC", format = "%H:%M:%S %d-%b-%Y", ...)

Arguments

d

either a character vector of dates or an object of a class which extends sattagstream.

tz, format

as expected by as.POSIXct.

...

any other good stuff you want to pass to as.POSIXct.

Details

methods are defined for converting objects of a class which extends sattagstream. note that the date formats and column names are inconsistent in the data streams download from the portal. for example, note the odd capitalization patterns in *-All.csv (and ambiguous date format). method is not fully implemented for summary because i've never seen the date format for ReleaseDate and DeployDate.

also, beware if you open any data stream csvs in excel and re-save, the dates will likely be put into an absurb ambiguous form. additionally, seconds tend to be obliterated.

this methods may become defunct if wildlife updates their conventions and will have to be updated.

Methods (by class)

  • sattagstream: for generic sattagstreams

  • all: for *-All.csv. note the different time format.

  • behavior: for *-Behavior.csv

  • corrupt: for *-Corrupt.csv

  • fastgps: for *-FastGPS.csv

  • rawargos: for *-RawArgos.csv

  • rtc: for *-RTC.csv

  • series: for *-Series.csv

  • seriesrange: for *-SeriesRange.csv

  • locations: for *-Locations.csv

  • status: for *-Status.csv

  • summary: for *-Summary.csv note: not sure how to implement ReleaseDate or DeployDate...

See Also

as.POSIXct

Other date manipulators: num2date()

Examples

date2num("1988-03-12 07:00:00", tz = "UTC", format = "%Y-%m-%d %H:%M:%S")

williamcioffi/sattagutils documentation built on June 3, 2022, 10:21 a.m.