From 95221e44d27cf97d83e4963126f5e81f46ba63ff Mon Sep 17 00:00:00 2001 From: Michaja Pehl Date: Tue, 25 Jun 2024 17:02:48 +0200 Subject: [PATCH 1/2] soft-deprecate read.gdx(factors = ) --- NAMESPACE | 2 ++ R/read.gdx.R | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index da9e8a0..41446c0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -130,6 +130,8 @@ importFrom(lazyeval,interp) importFrom(lazyeval,lazy_dots) importFrom(lazyeval,lazy_eval) importFrom(lifecycle,deprecate_warn) +importFrom(lifecycle,deprecated) +importFrom(lifecycle,is_present) importFrom(lubridate,is.POSIXct) importFrom(magclass,"getNames<-") importFrom(magclass,"getSets<-") diff --git a/R/read.gdx.R b/R/read.gdx.R index b517546..7c5d0f1 100644 --- a/R/read.gdx.R +++ b/R/read.gdx.R @@ -9,18 +9,24 @@ #' @param fields fields to read from variables and equations (any of `lo`, #' `l`, `m`, and `up`); ignored for parameters #' @param colNames string vector of column names to override dimension names -#' @param factors return non-numerical columns as factors (default) or character -#' vectors -#' @param squeeze if TRUE, squeeze out any zero or EPS stored in the GDX +#' @param factors Deprecated. Do not use any more. +#' @param squeeze if `TRUE`, squeeze out any zero or EPS stored in the GDX #' container #' @return quitte data frame #' @author Michaja Pehl #' +#' @importFrom lifecycle deprecated deprecate_warn is_present #' @importFrom tibble as_tibble #' #' @export read.gdx <- function(gdxName, requestList.name, fields = "l", colNames = NULL, - factors = TRUE, squeeze = TRUE) { + factors = deprecated(), squeeze = TRUE) { + + if (is_present(factors)) + { + deprecate_warn('0.3135.0', 'quitte::read.gdx(factors = )', + details = 'Please do not use the argument anymore.') + } # Check if gdxrrw package is installed if (!any(.packages(all.available = TRUE) == "gdxrrw")) @@ -117,10 +123,5 @@ read.gdx <- function(gdxName, requestList.name, fields = "l", colNames = NULL, data <- as_tibble(data.frame(data)) - if (!factors) { - data <- data %>% - character.data.frame() - } - return(data) } From 66fd907c58313b7cea5ec2bd389fcc31b5993013 Mon Sep 17 00:00:00 2001 From: Michaja Pehl Date: Wed, 26 Jun 2024 14:42:49 +0200 Subject: [PATCH 2/2] lucode hubbub --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- README.md | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 17486a2..10749b5 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '623603320' +ValidationKey: '623865000' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/CITATION.cff b/CITATION.cff index cfad9e3..9376093 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,8 +2,8 @@ cff-version: 1.2.0 message: If you use this software, please cite it using the metadata from this file. type: software title: 'quitte: Bits and pieces of code to use with quitte-style data frames' -version: 0.3134.0 -date-released: '2024-06-24' +version: 0.3135.0 +date-released: '2024-06-26' abstract: A collection of functions for easily dealing with quitte-style data frames, doing multi-model comparisons and plots. authors: diff --git a/DESCRIPTION b/DESCRIPTION index 15a6828..f18e6ff 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: quitte Title: Bits and pieces of code to use with quitte-style data frames -Version: 0.3134.0 -Date: 2024-06-24 +Version: 0.3135.0 +Date: 2024-06-26 Authors@R: c( person("Michaja", "Pehl", , "pehl@pik-potsdam.de", role = c("aut", "cre")), person("Nico", "Bauer", , "nicolasb@pik-potsdam.de", role = "aut"), diff --git a/README.md b/README.md index ff64556..67d977d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Bits and pieces of code to use with quitte-style data frames -R package **quitte**, version **0.3134.0** +R package **quitte**, version **0.3135.0** [![CRAN status](https://www.r-pkg.org/badges/version/quitte)](https://cran.r-project.org/package=quitte) [![R build status](https://github.com/pik-piam/quitte/workflows/check/badge.svg)](https://github.com/pik-piam/quitte/actions) [![codecov](https://codecov.io/gh/pik-piam/quitte/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/quitte) [![r-universe](https://pik-piam.r-universe.dev/badges/quitte)](https://pik-piam.r-universe.dev/builds) @@ -47,7 +47,7 @@ In case of questions / problems please contact Michaja Pehl . +Pehl M, Bauer N, Hilaire J, Levesque A, Luderer G, Schultes A, Dietrich J, Richters O (2024). _quitte: Bits and pieces of code to use with quitte-style data frames_. R package version 0.3135.0, . A BibTeX entry for LaTeX users is @@ -56,7 +56,7 @@ A BibTeX entry for LaTeX users is title = {quitte: Bits and pieces of code to use with quitte-style data frames}, author = {Michaja Pehl and Nico Bauer and Jérôme Hilaire and Antoine Levesque and Gunnar Luderer and Anselm Schultes and Jan Philipp Dietrich and Oliver Richters}, year = {2024}, - note = {R package version 0.3134.0}, + note = {R package version 0.3135.0}, url = {https://github.com/pik-piam/quitte}, } ```