Below is some simulated data which shows what happens with different combinations of available and missing data per individual animal.
I have also included a second example of what happens if PDOP and DOP columns are included in the same dataframe before conversion to telemtry object using as.telemtry. I have done this because for some individuals I have PDOP and DOP values (never simultaneously for same location). I wasn't sure if PDOP/DOP is ever associated with location on data upload but I assume it isn't, so I probably need to use both PDOP and DOP values if they are equivalent. I can just copy the DOP values across into the empty PDOP cells as I have mostly PDOP values or am missing values for both PDOP and DOP.
library(dplyr)
library(lubridate)
# Create example data
# Concatenate the vectors
ID <- c("Alex", "Alex", "Alex", "Alex", "Alex", "Alex", "Alex", "Alex", "Betty", "Betty", "Betty", "Betty", "Conrad", "Conrad", "Conrad", "Conrad")
timestamp <- as.POSIXct(c("2023-01-16 19:58:53", "2023-04-14 23:16:37", "2023-05-29 03:49:20", "2023-07-11 12:31:46", "2023-10-14 05:38:01", "2023-11-17 16:02:24", "2023-11-21 02:10:21", "2023-12-08 13:55:19", "2023-06-14 07:19:37", "2023-06-15 11:59:10", "2023-07-20 00:20:10", "2023-12-14 12:53:45", "2023-02-06 17:09:00", "2023-07-27 17:31:31", "2023-09-03 22:15:25", "2023-11-23 18:52:15"), tz = "US/Pacific")
latitude <- c(41.92803, 37.46088, 38.27921, 41.40507, 35.42060, 44.54504, 44.94270, 43.89539, 40.94142, 42.08530, 41.55706, 40.44066, 44.63024, 36.47114, 37.89160, 44.02299)
longitude <- c(-115.6718, -106.1859, -119.5077, -113.6364, -104.0907, -110.4441, -115.3675, -104.8308, -112.6231, -111.7091, -117.1440, -111.7255, -115.3393, -117.2239, -116.9511, -110.6808)
pdop <- c(NA, 1.4, 0.3, NA, 4.3, 2.3, NA, NA, 4.3, 0.7, 4.0, 1.4, NA, NA, NA, NA)
dop <- c(4.5, NA, NA, 3.8, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA)
# Create the dataframe
test <- data.frame(ID, timestamp, latitude, longitude, pdop, dop)
# Display the dataframe
print(test)
## ############################################## ##
## Example of various combinations of PDOP values ##
## ############################################## ##
# This is how my data currently exists, i.e. without the dop column.
# Drop dop column for this test
test1 <- test[, 1:5]
# Display the dataframe
print(test1)
# Convert to telemetry object
test1_ctmm <- as.telemetry(test1, timeformat = "%Y-%m-%d %H:%M:%S", timezone = "US/Pacific", na.rm = "row", keep = T, drop = F)
# View each resulting telemtry object
# Alex - Contained pdop values and missing pdop values in original dataset
alex <- test1_ctmm$Alex
print(alex) # All 4 NA cells in pdop column are dropped. All remaining pdop cell values are assigned to HDOP column and class [HDOP] assigned
# Betty - No missing pdop values in original dataset
betty <- test1_ctmm$Betty
print(betty) # All rows retained because all pdop cells contain values. All pdop values assigned to HDOP column and class [HDOP] assigned
# Conrad - No pdop values in original dataset
conrad <- test1_ctmm$Conrad
print(conrad) # No rows dropped because all pdop cells did not have a value and so an HDOP value of 100 is assigned to all cells as is class [NA-HDOP]
## ############################################### ##
## Example of PDOP and DOP column in same datframe ##
## ############################################### ##
# I have pdop and dop values for some individuals (never simultaneously for same location) and below is what happens when both pdop and dop columns are included in dataframe when converting to telemtry object using as.telemtry.
# Rename dataframe with included dop column
test2 <- test
# Convert to telemetry object
test2_ctmm <- as.telemetry(test2, timeformat = "%Y-%m-%d %H:%M:%S", timezone = "US/Pacific", na.rm = "row", keep = T, drop = F)
# View each resulting telemtry object
# Alex - Contained pdop values and missing pdop values in original dataset
alex <- test2_ctmm$Alex
print(alex) # Again, all 4 NA cells in pdop column are dropped and dop column is dropped, but this time pdop cell values are not assigned and instead a HDOP value of 100 is assigned to all cells as is class [NA-HDOP].
# Betty - No missing pdop values in original dataset
betty <- test2_ctmm$Betty
print(betty) # All rows retained because all pdop cells contain values but like above, this time pdop cell values are not assigned and instead a HDOP value of 100 is assigned to all cells as is class [NA-HDOP].
# Conrad - No pdop values in original dataset
conrad <- test2_ctmm$Conrad
print(conrad) # No rows dropped because all pdop cells did not have a value and so an HDOP value of 100 is assigned to all cells as is class [NA-HDOP]
Cheers,
Luke