Learn R Programming

move (version 3.2.2)

getDuplicatedTimestamps: Identifies duplicated timestamps

Description

Identifies all pairs of duplicated timestamps within an individual and sensor type from data downloaded from Movebank or own data.

Usage

# S4 method for character
getDuplicatedTimestamps(x, ..., onlyVisible = TRUE)
 
  # S4 method for factor
getDuplicatedTimestamps(x, timestamps, sensorType, visible=NULL, ...)

Arguments

x

full path to the csv (or compressed) file location downloaded from a Movebank study, or to the zip file location downloaded from the EnvData tool in Movebank. data.frame read into R from a csv file downloaded from Movebank. factor containing the name(s) of the individual(s) if non-Movebank data are provided.

timestamps

vector containing timestamps with POSIXct conversion if non-Movebank data are provided,i.e. as.POSIXct(data$timestamp, format="%Y-%m-%d %H:%M:%S", tz="UTC")

sensorType

optional, character or vector of characters containing sensor type(s) if non-Movebank data are provided.

onlyVisible

logical, indicating if the visible column in the movebank data should be considered when the column visible is present, the default is to ignore all non-visible/outlier locations

visible

optional, a logical vector indicating the locations that should be considered.

...

currently not implemented

Value

This function returns a list. The name of the list elements contains the individual's name, the timestamp that is duplicated and the sensor type (if provided). Each list element contains a vector with the corresponding row numbers where the duplicated timestamps are located in the table. If no duplicated timestamps are found NULL is returned.

Details

If own data (non-Movebank) are used, the vectors specified in "x", "timestamps" and optionally "visible" have to have the same length.

Examples

Run this code
# NOT RUN {
data(duplicatedDataExample)
getDuplicatedTimestamps(x=as.factor(duplicatedDataExample$individual.id), 
                        timestamps=as.POSIXct(duplicatedDataExample$timestamps, 
					      format="%Y-%m-%d %H:%M:%S", tz="UTC"),
                        sensorType=duplicatedDataExample$sensor.type)

filePath<-system.file("extdata","leroy.csv.gz",package="move")
getDuplicatedTimestamps(filePath)


# }

Run the code above in your browser using DataLab