jedalong / wildlifeDI

R package for analysing interactions in wildlife telemetry data.
16 stars 3 forks source link

Issue with conTimeLag #8

Open EmilyBennitt opened 3 months ago

EmilyBennitt commented 3 months ago

Hi Jed,

I'm trying use WildlifeDI to extract before and after contact data following the Contact Analysis Workflow. I'm getting no negative values in the contact_timelag column so nothing is being attributed to 'before', and I'm getting quite a few NAs even though I started with just 2 animals and there were two contacts between them. I tried varying the value for pc in conPhase but there was no effect.

Any advice would be appreciated! Thanks Emily

Code:

m<-mt_as_move2(t) o<-GetTO(m) low<-conProcess(o,dc=2000,tc=144060) l <- conPhase(low, pc=144060) l <- conTimelag(l,def='all') l$dt_lev <- cut(l$contact_timelag, breaks = c(-Inf,-144060,-6060,6060,144060,Inf), labels = c("Other","Before","Contact","After","Other")) table(l$dt_lev) Other Before Contact After 65286 0 13 78 summary(l$contact_timelag) Min. 1st Qu. Median Mean 3rd Qu. Max. NA's 0 7342745 13270913 13397120 19645187 25625193 27713

jedalong commented 2 months ago

Hi Emily

  1. Sorry i am so very behind on fixing code!!!!
  2. There is a discrepency in the code on github and the code on CRAN because I was getting an error when submitting my bug fixes to CRAN; so can you use devtools::install_github(jedalong/wildlifeDI) and see if you still get this problem when using the GITHUB code?