From a5f56ecef13f31ae8df60d504c15ad7535e33d7f Mon Sep 17 00:00:00 2001 From: kauedesousa Date: Thu, 25 Jan 2024 21:50:00 +0100 Subject: [PATCH] v1.2 --- DESCRIPTION | 2 +- NEWS.md | 7 +++++++ R/as.data.frame-climmob_list.R | 22 +++++----------------- codemeta.json | 4 ++-- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9a6e730..a6b0898 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ClimMobTools Type: Package Title: API Client for the 'ClimMob' Platform -Version: 1.1 +Version: 1.2 Authors@R: c(person("KauĂȘ", "de Sousa", email = "desousa.kaue@gmail.com", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 4b386c7..2188919 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +ClimMobTools 1.2 (2024-01-25) +========================= + +### BUG FIXES + +* Improves indexing of technologies aliases in `ClimMobTools:::as.data.frame()` + ClimMobTools 1.1 (2023-11-28) ========================= diff --git a/R/as.data.frame-climmob_list.R b/R/as.data.frame-climmob_list.R index 8bbf4b4..775ddec 100644 --- a/R/as.data.frame-climmob_list.R +++ b/R/as.data.frame-climmob_list.R @@ -258,23 +258,11 @@ as.data.frame.CM_list <- function(x, # comparisons and package comps <- dat[["packages"]][, "comps"] - if (ncomp == 3) { - comps <- lapply(comps, function(x) { - x <- unique(unlist(x$technologies)) - x <- x[-1] - names(x) <- paste0("item_", LETTERS[1:length(x)]) - x - }) - } - - if (ncomp > 3) { - comps <- lapply(comps, function(x) { - x <- unique(unlist(x$technologies)) - x <- x[-1] - names(x) <- paste0("item_", 1:length(x)) - x - }) - } + comps <- lapply(comps, function(x) { + x <- do.call("rbind", x$technologies)[,"alias_name"] + names(x) <- paste0("item_", LETTERS[1:length(x)]) + x + }) comps <- do.call("rbind", comps) diff --git a/codemeta.json b/codemeta.json index 8c77f81..c254b8c 100644 --- a/codemeta.json +++ b/codemeta.json @@ -7,7 +7,7 @@ "codeRepository": "https://agrdatasci.github.io/ClimMobTools/", "issueTracker": "https://github.com/agrdatasci/ClimMobTools/issues", "license": "https://spdx.org/licenses/MIT", - "version": "1.1", + "version": "1.2", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -234,7 +234,7 @@ }, "SystemRequirements": null }, - "fileSize": "1328.135KB", + "fileSize": "1328.066KB", "citation": [ { "@type": "ScholarlyArticle",