From c9a5c2bc5a32dc24d99a31f6609f0829da1a395b Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 22 Nov 2023 15:06:00 +0100 Subject: [PATCH 1/6] Conversion: copy first source entirely to platform --- R/zzz.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/zzz.R b/R/zzz.R index d4d3f075..c67fc533 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -497,7 +497,8 @@ convert_metadata_to_0.1.6 <- function(package, from = "1.0"){ "The field `sequenceInterval` is deprecated in version {from}." )) } - package$platform <- package$sources[[1]]$title + package$platform <- package$sources[[1]] + # `title` value of the first contributor with role `rightsHolder` package$rightsHolder <- purrr::map_df(package$contributors, unlist) %>% dplyr::filter(.data$role == "rightsHolder") %>% From 53381b77ea219adddb4a6a85fa5bf8a104679d26 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 22 Nov 2023 15:06:12 +0100 Subject: [PATCH 2/6] Bump version to 0.21.0.9000 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6e637177..75ec3760 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: camtraptor Title: Read, Explore and Visualize Camera Trap Data Packages -Version: 0.21.0 +Version: 0.21.0.9000 Authors@R: c( person("Damiano", "Oldoni", email = "damiano.oldoni@inbo.be", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-3445-7562")), From 7da58bf6561a1ffae66b81fef87f3df8616f200c Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 22 Nov 2023 16:03:03 +0100 Subject: [PATCH 3/6] Use simpler way to order --- R/write_eml.R | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/R/write_eml.R b/R/write_eml.R index bb2a1ad4..a7d9b036 100644 --- a/R/write_eml.R +++ b/R/write_eml.R @@ -167,10 +167,7 @@ write_eml <- function(package, ) } # Sort contributors on order in creators - contributors <- dplyr::slice( - contributors, - order_by = order(factor(.data$title, levels = creators)) - ) + contributors <- arrange(contributors, factor(title, level = creators)) } creator_list <- purrr::transpose(contributors) # Create list message(glue::glue( From bce9d12bdd08e73c8e982c69c0f6bab2e8bc98fd Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Wed, 22 Nov 2023 17:12:50 +0100 Subject: [PATCH 4/6] Include taxonID from taxonomy in observations --- R/zzz.R | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/R/zzz.R b/R/zzz.R index c67fc533..9f40e361 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -367,19 +367,25 @@ add_taxonomic_info <- function(package) { taxon_infos <- dplyr::select( taxon_infos, dplyr::all_of("scientificName"), - dplyr::any_of(c("taxonIDReference", - "taxonRank")), + dplyr::any_of(c("taxonID", "taxonIDReference", "taxonRank")), dplyr::starts_with("vernacularNames") ) - # add taxon infos to observations + # Add taxon infos to observations if (!is.null(taxon_infos)) { cols_taxon_infos <- names(taxon_infos) observations <- dplyr::left_join( package$data$observations, taxon_infos, - by = c("scientificName") + by = "scientificName" ) + if ("taxonID.y" %in% colnames(observations)) { + # Keep only the taxonID added by join with taxonomy + observations <- + observations %>% + rename("taxonID" = "taxonID.y") %>% + select(-"taxonID.x") + } package$data$observations <- observations } return(package) From df14adadbf03feabfca8d60aa28ca40dd9e7700b Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Thu, 23 Nov 2023 21:00:03 +0100 Subject: [PATCH 5/6] Update version to 0.22.0 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 75ec3760..40885967 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: camtraptor Title: Read, Explore and Visualize Camera Trap Data Packages -Version: 0.21.0.9000 +Version: 0.22.0 Authors@R: c( person("Damiano", "Oldoni", email = "damiano.oldoni@inbo.be", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-3445-7562")), From cd3bbf987e3c51a13c0a10e732968ccc2c06e188 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Thu, 23 Nov 2023 21:23:02 +0100 Subject: [PATCH 6/6] Describe 0.22.0 in NEWS --- NEWS.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS.md b/NEWS.md index d832c816..a5192b3c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# camtraptor 0.22.0 + +- Fix bug in `write_eml()` for Camtrap DP 1.0 datasets (#290). +- `read_camtrap_dp()` will now always populate `taxonID` from the + `package.taxonomy` (#290). + # camtraptor 0.21.0 - `read_camtrap_dp()` supports Camtrap DP 1.0 (upcoming Agouti export format)