readLocs {diveMove}R Documentation

Read comma-delimited file with location data

Description

Read a comma delimited (*.csv) file with (at least) time, latitude, longitude readings.

Usage

readLocs(file, loc.idCol, idCol, dateCol, timeCol=NULL,
         dtformat="%m/%d/%Y %H:%M:%S", tz="GMT",
         classCol, lonCol, latCol, alt.lonCol=NULL, alt.latCol=NULL, ...)

Arguments

file A string indicating the name of the file to read. Provide the entire path if the file is not on the current directory.
loc.idCol Column number containing location ID. If missing, a loc.id column is generated with sequential integers as long as the input.
idCol Column number containing an identifier for locations belonging to different groups. If missing, an id column is generated with number one repeated as many times as the input.
dateCol Column number containing dates, and, optionally, times.
timeCol Column number containing times.
dtformat A string, specifying the format in which the date and time columns, when pasted together, should be interpreted (see strptime) in file.
tz A string indicating the time zone for the date and time readings.
lonCol Column number containing longitude readings.
latCol Column number containing latitude readings.
classCol Column number containing the ARGOS rating for each location.
alt.lonCol Column number containing alternative longitude readings.
alt.latCol Column number containing alternative latitude readings.
... Passed to read.csv

Details

The file must have a header row identifying each field, and all rows must be complete (i.e. have the same number of fields). Field names need not follow any convention.

Value

A data frame.

Author(s)

Sebastian P. Luque spluque@gmail.com

Examples


locs <- readLocs(system.file(file.path("data", "sealLocs.csv"),
                             package="diveMove"), idCol=1, dateCol=2,
                 dtformat="%Y-%m-%d %H:%M:%S",
                 classCol=3, lonCol=4, latCol=5)

summary(locs)


[Package diveMove version 0.9.5 Index]