Identifies duplicated timestamps
getDuplicatedTimestamps.Rd
Identifies all pairs of duplicated timestamps within an individual and sensor type from data downloaded from Movebank or own data.
Usage
# S4 method for class 'character'
getDuplicatedTimestamps(x, ..., onlyVisible = TRUE)
# S4 method for class '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, or downloaded withgetMovebankLocationData
.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
Details
If own data (non-Movebank) are used, the vectors specified in "x", "timestamps" and optionally "visible" have to have the same length.
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.
Examples
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)
#> $`Bob|2009-02-11 18:45:45.0000|gps`
#> [1] 3 4
#>
#> $`Eva|2010-03-31 15:58:11.0000|gps`
#> [1] 8 9
#>
filePath<-system.file("extdata","leroy.csv.gz",package="move")
getDuplicatedTimestamps(filePath)
#> NULL