MarcusRowcliffe / camtrapDensity

1 stars 0 forks source link

plot_deployment_schedule fully compatible with camtrapdp package? #39

Open bramdhondt opened 1 week ago

bramdhondt commented 1 week ago

Hello Marcus,

it strikes me that the plot_deployment_schedule() function (most handy!) works well when the data are loaded using the camtraptor package, but not when loaded using the camtrapdp package.

set1 <- camtraptor::read_camtrap_dp("./Exoten/spp_muntjak/input/Vordenstein/datapackage.json")
camtrapDensity::plot_deployment_schedule(set1)

Yes, plot retrieved, as expected !

set2 <- camtrapdp::read_camtrapdp("./Exoten/spp_muntjak/input/Vordenstein/datapackage.json")
camtrapDensity::plot_deployment_schedule(set2)

Computer says no !

Error in `.data$timestamp`:
! Column `timestamp` not found in `.data`.
Backtrace:
  1. camtrapDensity::plot_deployment_schedule(set2)
 15. rlang:::abort_data_pronoun(x, call = y)

Since all packages are in full development, I append my versions here:

Maybe worth checking?

Regards, Bram (INBO)

MarcusRowcliffe commented 1 week ago

Hi Bram

Thanks for this. I'm guessing that the internal camtrapdp data model is CamtrapDP 1.0, and it does not down-version data provided in that format as camtraptor does. camtrapDensity uses Camtrap DP V0.1, so down-versioning is currently required. The short term fix is to use camtraptor or camtrapDensity alone. The longer term fix is to shift everything to V1.0, which I will do when I get a chance. When is camtraptor going to make that shift? Would be good to co-ordinate on this.

All best Marcus

From: bramdhondt @.> Sent: Tuesday, June 25, 2024 12:00 PM To: MarcusRowcliffe/camtrapDensity @.> Cc: Subscribed @.***> Subject: [EXT]: [MarcusRowcliffe/camtrapDensity] plot_deployment_schedule fully compatible with camtrapdp package? (Issue #39)

Hello Marcus,

it strikes me that the plot_deployment_schedule() function (most handy!) works well when the data are loaded using the camtraptor package, but not when loaded using the camtrapdp package.

set1 <- camtraptor::read_camtrap_dp("./Exoten/spp_muntjak/input/Vordenstein/datapackage.json")

camtrapDensity::plot_deployment_schedule(set1)

Yes, plot retrieved, as expected !

set2 <- camtrapdp::read_camtrapdp("./Exoten/spp_muntjak/input/Vordenstein/datapackage.json")

camtrapDensity::plot_deployment_schedule(set2)

Computer says no !

Error in .data$timestamp:

! Column timestamp not found in .data.

Backtrace:

  1. camtrapDensity::plot_deployment_schedule(set2)

    1. rlang:::abort_data_pronoun(x, call = y)

Since all packages are in full development, I append my versions here:

Maybe worth checking?

Regards, Bram (INBO)

- Reply to this email directly, view it on GitHubhttps://github.com/MarcusRowcliffe/camtrapDensity/issues/39, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG2EJMCUN6BOUSWRO2PMSI3ZJFEUBAVCNFSM6AAAAABJ3S7OQ2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3TEMZYGE4TOMY. You are receiving this because you are subscribed to this thread.Message ID: @.***>


The Zoological Society of London is incorporated by Royal Charter - Registered Charity in England and Wales no. 208728. Principal Office England - Company Number RC000749 - Registered address Regent's Park, London, England NW1 4RY


This e-mail has been sent in confidence to the named addressee(s). If you are not the intended recipient, you must not disclose or distribute it in any form, and you are asked to contact the sender immediately. Views or opinions expressed in this communication may not be those of The Zoological Society of London and, therefore, The Zoological Society of London does not accept legal responsibility for the contents of this message. The recipient(s) must be aware that e-mail is not a secure communication medium and that the contents of this mail may have been altered by a third party in transit.

If you have any issues regarding this mail please visit: https://www.zsl.org/about-us/contact-us

bramdhondt commented 1 week ago

Hello Marcus, thans for you reply. I will forward your question to my colleagues. (I'm a just a user, not a developer.)

Indeed, most of the camtrapDensity functions do not work when the data is loaded through the camtrapdp package.

Until further notice, I will read the data using your _readcamtrapDP function, which is the most secure way for avoiding havoc.

damianooldoni commented 1 week ago

👋 @bramdhondt! I answer to you here as you mentioned this issue in your mail. In this way @MarcusRowcliffe is also informed. @MarcusRowcliffe: please feel free to move this as a different issue/discussion if you prefer.

@MarcusRowcliffe is right: camtraptor is still downconverting, camtrapdp not.

To make things clear: why did we develop camtrapdp? The idea about camtrapdp package (which is since few weeks on CRAN) is to allow researchers/developers to use it for reading and manipulating Camera Trap Data Packages. camtraptor was really getting huge in scope and so in dependencies: reading, filtering, returning summaries and leaflet maps for deployment visualizations! Definitely too much. Jurgen Niedballa (developer of camtrapR) was also interested in reading Camera Trap Data Packages and so, providing a more dedicated package "nearer" to the data format instead of the researcher output was needed. Thanks to camtrapdp package, everyone who wants to develop a research dedicated package can start without thinking too much about reading/writing/manipulating camtrap data packages.

In this way, camtraptor will focus on its summary functions (the get_* functions, e.g. get_rai(), get_obs()) and leaflet visualizations. However, researchers using camtraptor won't need to load also camtrapdp to read their packages. camtraptor will still have its reading function: behind the screen we will use camtrapdp! In this way researchers as you, @bramdhondt, don't need to load two packages to work with camtrap data packages.

My INBO colleagues Peter, Sanne, Pieter and I are planning a "camtraptor code sprint" next week (2-4 July) to update camtraptor: by using camtrapdp to read the data we will stop also the downconversion. If all the work is not done in that sprint, I will work further the days after. July is my "camtraptor month".

@MarcusRowcliffe: I am more than happy to get in touch with you for coordinating this. Please, mail me! @bramdhondt: if something is not clear, you know where to find me 😄