RossDwyer / VTrack

V-Track: software for analysing and visualising animal movement from acoustic telemetry detections
https://cran.r-project.org/web/packages/VTrack/index.html
13 stars 5 forks source link

Estimating MCP and BBKUD #18

Open Caelin1234 opened 3 years ago

Caelin1234 commented 3 years ago

Hi, I am having trouble with estimating mcp and BBKUD. I get the following error: mcp_error

grace-casselberry commented 2 years ago

Hi Ross and @vinayudyawer,

I am also having this same issue with my acoustic telemetry data. The code seems to run fine on the sample data but when I run it on my own data I get the same errors as Caelin:

`

mcp_est <- HRSummary(COAdata = COAdata, projCRS = proj, type = "MCP", cont = 100, sub = "%Y-%m") |=========== | 14% Error in Tag.ID: GHH11 numbers of columns of arguments do not match |================= | 21% Error in Tag.ID: GHH12 numbers of columns of arguments do not match |======================= | 29% Error in Tag.ID: GHH13 numbers of columns of arguments do not match |============================= | 36% Error in Tag.ID: GHH14 numbers of columns of arguments do not match |================================== | 43% Error in Tag.ID: GHH16 numbers of columns of arguments do not match |======================================== | 50% Error in Tag.ID: GHH3 numbers of columns of arguments do not match |============================================== | 57% Error in Tag.ID: GHH4 numbers of columns of arguments do not match |=================================================== | 64% Error in Tag.ID: GHH5 numbers of columns of arguments do not match |========================================================= | 71% Error in Tag.ID: GHH6 numbers of columns of arguments do not match |=============================================================== | 79% Error in Tag.ID: GHH7 numbers of columns of arguments do not match |===================================================================== | 86% Error in Tag.ID: GHH9 numbers of columns of arguments do not match |========================================================================== | 93% Error in Tag.ID: Hook numbers of columns of arguments do not match |================================================================================| 100% Error: x and y must share the same src, set copy = TRUE (may be slow)`

rlang::last_trace() <error/rlang_error> x and y must share the same src, set copy = TRUE (may be slow). Backtrace: █

  1. └─VTrack::HRSummary(...)
  2. ├─dplyr::left_join(full, fullout, by = c("Tag.ID"), all.x = T)
  3. └─dplyr:::left_join.data.frame(...)
  4. └─dplyr::auto_copy(x, y, copy = copy)
  5. └─dplyr:::glubort(...)`

The "numbers of columns of arguments do not match" error is happening for all but the first two individuals in my dataset. I've gone through your vignette and sample data carefully. It seems that my data frames match yours and everything is in the desired format. COAs are generating fine from what I can tell. I'm unsure what my data is doing to break the dplyr code under the hood.

Any insights would be greatly appreciated. I can share some sample data privately if needed. Thanks!

vinayudyawer commented 2 years ago

@grace-casselberry would you be able to share a small portion of your data and code via email to figure out what's causing the error in the back end? With a few updates in dplyr there have been a few issues arising, and a reproducible example would be helpful to fix the problem.

If you can email me at v.udyawer@aims.gov.au, I'll see if I can help fix this issue on the package.

grace-casselberry commented 2 years ago

@vinayudyawer Thanks for offering to help. I just emailed you some data and code that cause the error. Hopefully there's a relatively simple fix with the dplyr code within the function.

Miguelbirostris commented 2 years ago

Hello! I am having a simmilar problem (working with VEMCO transmitters). Were you able to solve the issue?

mcp_estgc <- HRSummary(COAdata = COAdatagc,

|=======================================================================================| 100% Error in auto_copy(): ! x and y must share the same src. ℹ set copy = TRUE (may be slow). Run rlang::last_error() to see where the error occurred.

rlang::last_error() <error/rlang_error> Error in auto_copy(): ! x and y must share the same src. ℹ set copy = TRUE (may be slow).

Backtrace:

  1. VTrack::HRSummary(...)
  2. dplyr:::left_join.data.frame(...)
  3. dplyr::auto_copy(x, y, copy = copy) Run rlang::last_trace() to see the full context. rlang::last_trace() <error/rlang_error> Error in auto_copy(): ! x and y must share the same src. ℹ set copy = TRUE (may be slow).

    Backtrace: ▆

  4. └─VTrack::HRSummary(...)
  5. ├─dplyr::left_join(full, fullout, by = c("Tag.ID"), all.x = T)
  6. └─dplyr:::left_join.data.frame(...)
  7. └─dplyr::auto_copy(x, y, copy = copy)
  8. └─rlang::abort(bullets)
AGREEN941 commented 1 year ago

I wasn't to sure if this had been resolved but unfortunatly the new updates on dplyr package causes the left_join ever.

If you put in: fix(HRSummary)

Go to line 65 and remove only , all.x = T

I found mine ran after this. however it still doesn't solve the issues when running: BBkud_est <- HRSummary(COAdata = COAdata, projCRS = proj, type = "BBKUD", cont = c(20,50,95), storepoly = TRUE, h = 600, ext = 2, grid = 200, div = 16)

Error messages: Error in saving subsetted BBKUD rasterstack for Tag.ID: 35879 error in evaluating the argument 'x' in selecting a method for function 'stack': no method for coercing this S4 class to a vector |=== | 2%Error in saving subsetted BBKUD rasterstack for Tag.ID: 35890 error in evaluating the argument 'x' in selecting a method for function 'stack': no method for coercing this S4 class to a vector |===== | 5%Error in saving subsetted BBKUD rasterstack for Tag.ID: 35891 error in evaluating the argument 'x' in selecting a method for function 'stack': no method for coercing this S4 class to a vector

TonyBicknell commented 10 months ago

Hi, was the original error posted by @Caelin1234 when using HRSummary ever resolved. I receive the error posted by @grace-casselberry when first attempting to use HRSummary, and when I alter the code as suggested by @AGREEN941 (dplyr version related) I then get @Caelin1234 's error related to x and y not shareing the same src. Any information/update would be greatly received, since I am keen to use the VTrack functions.

Caelin1234 commented 10 months ago

Hi, I ended up using a different analysis as I was finishing my work at the time. Unfortunately I have not returned to test any suggestions for this error. I apologize that I cannot provide any further insight. However I hope suggestions shared on this thread help resolve errors for those encountering the same issue!

TonyBicknell commented 10 months ago

Thanks for the quick reply @Caelin1234 . Did you find another method (R package) to calculate and plot similar activity space metrics? Hope you don't mind me asking, just thinking of a backup if I can't get HRSummary working.

Caelin1234 commented 10 months ago

@TonyBicknell I used RSP (https://github.com/YuriNiella/RSP) and before when I was learning I also tested Actel (https://github.com/hugomflavio/actel/) but I really wanted to use Vtracks. Some colleagues had no issues and this worked fine for them unfortunately it was a time crunch for me. I didn't want to promote a different package on this thread. I think all are great and I appreciate those who have shared and developed packages so much!

GarrisonFishes commented 4 months ago

Hi @vinayudyawer

I am encountering the same issues as discussed before. I am a master's student still learning R skills so there may be an issue with my data, but I am unable to get past these errors right now:

Screenshot 2024-04-16 at 11 14 15 AM

Please let me know if I could get in touch with you for some help,

Cheers,

Garrison