Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

getGPS fails if you convert ts to POSIX before running as in example #37

Open
plorch opened this issue Jan 19, 2022 · 3 comments
Open
Assignees

Comments

@plorch
Copy link

plorch commented Jan 19, 2022

If you follow the examples in 5.5.2 and 5.5.3, and run getGPS(), you will get errors because getGPS() expects ts to not be POSIX. You can fix this by running something like the code below first (leaving off the part converting the ts to POSIX timestamps from the code block immediately above the gps_index example).

df.alltags.sub <- tbl.filtered.alltags %>% 
  filter(probability == 1) %>%
  collect() %>%
  as.data.frame()

This highlights an inconsistency that many functions need ts in timestamp format, but not getGPS()

This is also related to issue #36 in that there are other places in the book where df.alltags.sub is generated without converting ts to a POSIX timestamp.

@StuMackenzie
Copy link

@steffilazerte

plorch added a commit to plorch/MotusRBook that referenced this issue Jan 19, 2022
Since getGPS expects raw time stamps, we need to regenerate the flat data frame without modifying the time stamps as in previous example

This fixes MotusWTS#37
@steffilazerte
Copy link
Member

Hi @plorch thanks for your troubleshooting!

We're in the process of revamping and updating the documentation, so a lot of it will change.

This is a good thing to include, and I'll definitely make it clearer in the getGPS() errors and documentation what the requirements are.

Timestamps are sometimes numeric because this allows us to manipulate the data before making it flat which can be much faster for larger data sets.

Thanks!

@plorch
Copy link
Author

plorch commented Jan 20, 2022 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants