removing DA species from the plots of a CommunityModel

63 views
Skip to first unread message

stefano...@gmail.com

unread,
Dec 12, 2023, 9:57:07 AM12/12/23
to camtrapR
Hi Jurgen and all camtrapR users, 

I am wondering if there is an easy solution for removing the DA species from the plots, either plot_effects and plot_coef,  of a CommunityModel. 

For example, in my model I have 43 species and I have used augmentation =c(maknown=60). The model estimates Number of Species ~50 however in all the plots there are 17 DA species, which I would like to remove from the plots. 

Any helps would be appreciate. 

Cheers, 
Stef



 

Jürgen Niedballa

unread,
Jan 1, 2024, 4:30:26 AMJan 1
to camtrapR

Hi Stefano,

this is currently not implemented, but it is a good idea, also for other functions in the community occupancy workflow. 

I opened a GitHub issue and will add the functionality sometime soon, certainly in January. 

https://github.com/jniedballa/camtrapR/issues/28

Best regards and happy new year!

--
You received this message because you are subscribed to the Google Groups "camtrapR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camtrapr+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/camtrapr/e5b4ffb2-964b-4327-b831-863b817d72f5n%40googlegroups.com.

stefano...@gmail.com

unread,
Jan 2, 2024, 11:05:48 AMJan 2
to camtrapR
Hi Jurgen, 

Amazing! Thank you very much for your kind support.

Cheers, 
Stef

stefano...@gmail.com

unread,
Feb 20, 2024, 1:24:50 AMFeb 20
to camtrapR
Hi, 

I am trying to removing the DA species from the plots of a community model, but when I source the original function, something is going wrong. 
I am attaching 2 screenshots from the first species because two screenshots of the whole plots were too big for posting.
Any ideas?

Stef


Screenshot 2024-02-20 at 07.23.12.png
Screenshot 2024-02-20 at 07.23.27.png

Jürgen Niedballa

unread,
Feb 25, 2024, 4:57:54 PMFeb 25
to stefano...@gmail.com, camtrapR
Please try with the dev branch on GitHub:
remotes::install_github("jniedballa/camtrapR", ref = "dev", build_vignettes = TRUE)
plot_coef and plot_effects both have a new argument "subsetSpecies". Include all species that you wish to show in that argument. The default is to show all species.

In the plot you shared something is clearly wrong, but I can't say for sure without seeing the code you used. I hope the new version provides a solution for you though.

On a side note, a quick and dirty solution (and generally not advisable) is to subset the underlying data of the plot object itself. For example (using an example from the vignette):
test <-  plot_effects(mod.jags,
                      fit.jags,
                      submodel = "state")
test$utm_y$data <- test$utm_y$data[test$utm_y$data$Species %in% c("EGY", "VTA"),]
test$utm_y

image.png
But in general it is better to filter before plotting, which is what the subsetSpecies arguments mentioned above do.

--
You received this message because you are subscribed to the Google Groups "camtrapR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camtrapr+u...@googlegroups.com.

Stefano Anile

unread,
Feb 28, 2024, 5:56:44 AMFeb 28
to Jürgen Niedballa, camtrapR
Hi Jürgen, 

Thank you very much for providing both solutions.
I have learned something more about manipulating ggplot objects.

Stef  


Reply all
Reply to author
Forward
0 new messages