animalnexus / feedr

R package for working with data collected from RFID feeder visits
https://animalnexus.github.io/feedr/
2 stars 1 forks source link

Issue with disp #9

Closed imillercrews closed 7 months ago

imillercrews commented 7 months ago

I'm having an issue with running the disp function. When I run it I get an error "object role not found". I believe I isolated the issue when it creates the 's' data frame when it passes it to the tidyr::complete(animal_id, role, fill = list(n)). I fixed this by adding a line

role <-levels(d$role)

I also had an issue with the creation of the 't' data frame. I was able to fix it by updating to the following line of code:

t <- d %>% tidyr::pivot_wider(names_from = role, values_from = animal_id) %>% dplyr::group_by(displacer, displacee) dplyr::summarize(n = length(displacee)) %>% dplyr::ungroup()

Lastly, I ran into issues with the check functions that they did not exist and the same thing with the pass=TRUE flag. Not sure what the problem with this part it. I ended up just marking out the lines with the following functions:

check_name check_time check_format keep_extra merge_extra

steffilazerte commented 7 months ago

Hi @imillercrews, thanks for opening these issues with how things are going.

Since you're having problems with the internal functions, I wonder if you're using the feedr package as a package, or as a script? It's designed to be used as a package and you can install it with the following code:

install.packages("feedr", repos = c("https://steffilazerte.r-universe.dev", "https://cran.r-project.org"))

However, as I mentioned in the other issue, I really haven't had much time lately to keep feedr up to date and so you may run into some problems (feel free to let me know!). I would like to and will, hopefully, have some time to address these issues later this spring.

If you're using feedr as a package and still run into errors with your script, consider sharing the code you're trying to run. Do you run into errors if you use the example data?