rethomics / scopr

Read Ethoscope data in R
http://rethomics.github.io
3 stars 6 forks source link

new installation - subsetting behavr table failing #17

Open estebanbeck opened 2 years ago

estebanbeck commented 2 years ago

Hi,

I installed a new computer with ubuntu 22.04 and install R and Rstudio. I am using Rstudio 2022.06.0 build 452

I can get the data and everything looks good. For instance, this kind of code runs ok:

ggetho(dt, aes(y=x_rel))+
  stat_pop_etho() +
  stat_ld_annotations()

but if I subset the database like this:

ggetho(dt[t>4700 & t<7100], aes(y=x_rel))+
  stat_pop_etho() +
  stat_ld_annotations()

I get this error:

Error in seq.default(from = first_d, to = right, by = period) :
  wrong sign in 'by' argument

The same happens if I subset by a metavariable employing xmv().

Any idea of which is the problem? I guess that I got new versions of everything and something is failing...

qgeissmann commented 2 years ago

Hello old friend, Thanks for reporting.

estebanbeck commented 2 years ago

Hello!

I can do dt[t>4700 & t<7100] or even dt[xmv(fly)>10], that works. And I do have data in the time window (I can see it when I don't subset).

The problem comes with the line stat_ld_annotations(). This bit works when I don't have any subsetting, but as soon as I add the subset it fails. The same happens with dt[between(t, 4700, 7100)]. The error is the one I mentioned originally.

However, it looks like I can't reproduce the error with the toy data I got from zenodo...