Skip to content

Commit 7fdf1b0

Browse files
authored
Bugfix/820 name backbone checklist (#822)
* fixes #819 * fixes #819
1 parent bbd0d96 commit 7fdf1b0

File tree

6 files changed

+80
-47
lines changed

6 files changed

+80
-47
lines changed

‎DESCRIPTION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Description: A programmatic interface to the Web Service methods
88
retrieving information on data providers, getting species occurrence
99
records, getting counts of occurrence records, and using the GBIF
1010
tile map service to make rasters summarizing huge amounts of data.
11-
Version: 3.8.4
11+
Version: 3.8.4.1
1212
License: MIT + file LICENSE
1313
Authors@R: c(
1414
person("Scott", "Chamberlain", role = "aut", comment = c("0000-0003-1444-9135")),

‎R/name_backbone.r‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,12 @@ process_name_backbone_output <- function(tt, args) {
246246
}
247247
classification <- if (!is.null(tt$classification)) {
248248
c <- bind_rows(lapply(tt$classification, tibble::as_tibble))
249+
if(any(duplicated(c$rank))) {
250+
c$rank <- make.unique(c$rank)
251+
}
249252
nv <- stats::setNames(c$name, tolower(c$rank))
250253
kv <- stats::setNames(c$key, paste0(tolower(c$rank), "Key"))
254+
251255
c <- tibble::as_tibble(as.list(c(nv, kv)))
252256
c
253257
} else {
@@ -269,7 +273,6 @@ process_name_backbone_output <- function(tt, args) {
269273
} else {
270274
NULL
271275
}
272-
273276
out <- do.call("cbind", rgbif_compact(list(usage,
274277
diagnostics,
275278
classification,

‎R/name_backbone_checklist.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ check_name_data = function(name_data) {
266266
left_most_index <- which(colnames(name_data) %in% name_aliases)[1]
267267
left_most_name <- colnames(name_data)[left_most_index]
268268
message("No 'scientificName' column found. Using leftmost '",original_colnames[left_most_index], "' as the 'scientificName' column.\nIf you do not want to use '", original_colnames[left_most_index], "' column, re-name the column you want to use 'scientificName'.")
269-
colnames(name_data) <- gsub(left_most_name,"scientificname",colnames(name_data))
269+
colnames(name_data) <- gsub(left_most_name,"scientificName",colnames(name_data))
270270
}
271271
name_data
272272
}

‎tests/fixtures/name_backbone.yml‎

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/fixtures/name_backbone_verbose_true.yml‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)