From 526edef0e4815ff8313b51de82a4144d9a77f4de Mon Sep 17 00:00:00 2001 From: Alessandro Samuel-Rosa Date: Mon, 28 Feb 2022 15:31:10 -0300 Subject: [PATCH] remove non-ASCII characters from comments --- DESCRIPTION | 4 +-- NEWS.md | 5 ++++ R/morphology.R | 33 +++++++++++---------- README.md | 2 +- build-package.R | 5 +++- cran-comments.md | 76 ++++-------------------------------------------- 6 files changed, 35 insertions(+), 90 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 764f8dc..0406922 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: febr Type: Package Title: Data Repository of the Brazilian Soil -Version: 1.9.8 -Date: 2022-02-19 +Version: 1.9.9 +Date: 2022-02-28 Authors@R: c( person("Alessandro", "Samuel-Rosa", role = c("aut", "cre"), email = "alessandrosamuelrosa@gmail.com", diff --git a/NEWS.md b/NEWS.md index ada7e4e..6fd61e1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,10 @@ # News +## febr 1.9.9 + +* __Bug fix.__ There were R code comments using non-ASCII characters. This was causing a warning in + Debian Linux, R-devel, clang, ISO-8859-15 locale. Those comments were removed in this patch. + ## febr 1.9.8 * __Improvement.__ Package description is clearer and follows CRAN policies. diff --git a/R/morphology.R b/R/morphology.R index fa5fff2..2a26fed 100644 --- a/R/morphology.R +++ b/R/morphology.R @@ -40,10 +40,9 @@ morphology <- dry_color <- 2 } else { # Fonte: https://stackoverflow.com/questions/8020848/ - # ú --> \u00fa + # Latin Small Letter U With Acute (U+00FA) https://unicodeplus.com/U+00FA wet_color <- grep( - pattern = "(\u00famido|\U00FAmida|umido|umida)", - x = res[!no_color][[i]]) + pattern = "(\u00famido|\U00FAmida|umido|umida)", x = res[!no_color][[i]]) dry_color <- grep(pattern = "(seco|seca)", x = res[!no_color][[i]]) } res[!no_color][[i]] <- @@ -53,14 +52,15 @@ morphology <- res <- do.call(rbind, res) colnames(res) <- c("cor_matriz_umido_munsell", "cor_matriz_seco_munsell") # Limpeza dos dados + # Latin Small Letter U With Acute (U+00FA) https://unicodeplus.com/U+00FA res[, 1] <- sub( - pattern = "(\u00famido|\U00FAmida|umido|umida)", - replacement = "", x = res[, 1]) # ú --> \u00fa + pattern = "(\u00famido|\U00FAmida|umido|umida)", replacement = "", x = res[, 1]) res[, 2] <- sub("(seco|seca)", "", res[, 2]) res <- sub(", ", "", res) res <- trimws(res) res <- sub(",", ".", res) - res <- sub("\u00be", "3/4", res) # ¾ --> \u00be + # U+00BE: Vulgar Fraction Three Quarters (Unicode Character) https://unicodeplus.com/U+00BE + res <- sub("\u00be", "3/4", res) }, structure = { res <- strsplit(x, ";") @@ -68,7 +68,8 @@ morphology <- res <- sapply(res, function(x) x[3]) res <- trimws(res) # Grau da estrutura - # ã --> \u00e3 + # Latin Small Letter A With Tilde (U+00E3) https://unicodeplus.com/U+00E3 + # Latin Small Letter C With Cedilla (U+00E7) https://unicodeplus.com/U+00E7 str_degree <- c("gr\u00e3os simples", "maci\u00e7a", "fraca", "moderada", "forte") idx <- list() for (i in seq_along(str_degree)) { @@ -80,7 +81,9 @@ morphology <- str_type <- c("laminar", "prism\u00e1tica", "colunar", "blocos angulares", "blocos subangulares", "granular") - no_str <- estrutura_grau %in% c("gr\u00e3os simples", "maci\u00e7a") # ç --> \u00e7 + # Latin Small Letter A With Tilde (U+00E3) https://unicodeplus.com/U+00E3 + # Latin Small Letter C With Cedilla (U+00E7) https://unicodeplus.com/U+00E7 + no_str <- estrutura_grau %in% c("gr\u00e3os simples", "maci\u00e7a") idx <- list() for (i in seq_along(str_type)) { idx[[i]] <- grepl(str_type[i], res[!no_str]) @@ -109,8 +112,8 @@ morphology <- idx <- grepl("cerosidade", res) res[idx] <- sapply(res0[idx], function(x) x[5]) res <- trimws(res) - # Consistência do solo úmido (friabilidade) - friabi <- + # Consistencia do solo úmido (friabilidade) + friabi <- c("solt(o|a)", "muito fri\u00e1vel", "fri\u00e1vel", "firme", "muito firme", "extremamente firme") idx <- list() @@ -121,7 +124,7 @@ morphology <- consistencia_umido <- rep(NA, length(res)) consistencia_umido <- apply(idx, 1, function(x) friabi[x][1]) consistencia_umido <- gsub("(o|a)", "o", consistencia_umido, fixed = TRUE) - # Consistência do solo seco (dureza) + # Consistencia do solo seco (dureza) dureza <- c("solt(o|a)", "maci(o|a)", "ligeiramente dur(o|a)", "dur(o|a)", "muito dur(o|a)", "extremamente dur(o|a)") @@ -133,8 +136,8 @@ morphology <- consistencia_seco <- rep(NA, length(res)) consistencia_seco <- apply(idx, 1, function(x) dureza[x][1]) consistencia_seco <- gsub("(o|a)", "o", consistencia_seco, fixed = TRUE) - # Consistência do solo molhado (plasticidade) - plasti_class <- + # Consistencia do solo molhado (plasticidade) + plasti_class <- c("n\u00e3o-pl\u00e1stic(o|a)", "ligeiramente pl\u00e1stic(o|a)", "pl\u00e1stic(o|a)", "muito pl\u00e1stic(o|a)") idx <- list() @@ -145,8 +148,8 @@ morphology <- plasticidade <- rep(NA, length(res)) plasticidade <- apply(idx, 1, function(x) plasti_class[x][1]) plasticidade <- gsub("(o|a)", "o", plasticidade, fixed = TRUE) - # Consistência do solo molhado (pegajosidade) - pegajo_class <- + # Consistencia do solo molhado (pegajosidade) + pegajo_class <- c("n\u00e3o pegajos(o|a)", "ligeiramente pegajos(o|a)", "pegajos(o|a)", "muito pegajos(o|a)") idx <- list() diff --git a/README.md b/README.md index 71a539c..8f5492e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Repositório de Dados do Solo Brasileiro [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) -[![packageversion](https://img.shields.io/badge/devel%20version-1.9.8-firebrick.svg?style=flat-square)](commits/master) +[![packageversion](https://img.shields.io/badge/devel%20version-1.9.9-firebrick.svg?style=flat-square)](commits/master) [![CRAN](https://www.r-pkg.org/badges/version/febr)](https://cran.r-project.org/package=febr) [![cran diff --git a/build-package.R b/build-package.R index f75ca44..068de39 100644 --- a/build-package.R +++ b/build-package.R @@ -29,7 +29,10 @@ devtools::check_win_devel("febr-package/") # check in R-hub ---- # rhub::validate_email(email = "alessandrosamuelrosa@gmail.com") # rhub::check_on_windows() -devtools::check_rhub("febr-package/") +# rhub::platforms() +platforms <- c("fedora-clang-devel", + "ubuntu-gcc-release", "debian-clang-devel", "windows-x86_64-devel") +devtools::check_rhub("febr-package/", platforms = platforms) devtools::build() diff --git a/cran-comments.md b/cran-comments.md index 51b2546..d422497 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -2,73 +2,20 @@ ## Changes -This is a minor release. It incorporates new functions that solve the errors found in the CRAN -check results on 2020-10-24. At that time, the package was archived as the following problems -(including not using Suggests conditionally) were not corrected in time: - -``` -Check Details - -Version: 1.1.0 -Check: examples -Result: ERROR - Running examples in 'febr-Ex.R' failed - The error most likely occurred in: - - > base::assign(".ptime", proc.time(), pos = "CheckExEnv") - > ### Name: febr2spdf - > ### Title: Create an sf object - > ### Aliases: febr2spdf febr2sf - > - > ### ** Examples - > - > res <- observation(dataset = "ctb0003", variable = "taxon", - + progress = FALSE, verbose = FALSE) - Error in `[.data.frame`(tmp, , c("coord_x", "coord_y")) : - undefined columns selected - Calls: observation -> apply -> [ -> [.data.frame - Execution halted -Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-patched-linux-x86_64, r-release-linux-x86_64 - -Version: 1.1.0 -Check: Rd cross-references -Result: NOTE - Undeclared package ‘openxlsx’ in Rd xrefs -Flavor: r-devel-linux-x86_64-fedora-clang - -Version: 1.1.0 -Check: examples -Result: ERROR - Running examples in ‘febr-Ex.R’ failed - The error most likely occurred in: - - > ### Name: febr2spdf - > ### Title: Create an sf object - > ### Aliases: febr2spdf febr2sf - > - > ### ** Examples - > - > res <- observation(dataset = "ctb0003", variable = "taxon", - + progress = FALSE, verbose = FALSE) - Error in `[.data.frame`(tmp, , c("coord_x", "coord_y")) : - undefined columns selected - Calls: observation -> apply -> [ -> [.data.frame - Execution halted -Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-patched-solaris-x86, r-release-windows-ix86+x86_64, r-oldrel-windows-ix86+x86_64 -``` - -This minor release also includes modifications to get rid of package dependencies as well as has -various code and documentation improvements. Finally, it defuncts a few obsolete functions. +This is a patch release. It includes modifications to get rid of warnings in tests under. +Debian Linux, R-devel, clang, ISO-8859-15 locale. Warnings were due to R code comments using +non-ASCII characters. Those comments were removed in this patch. ## Test environments * OK: local, x86_64-pc-linux-gnu (64-bit), Ubuntu 20.04.3 LTS, R version 4.1.2 (2021-11-01) * OK: winbuilder, x86_64-w64-mingw32 (64-bit), Windows, R version 4.0.5 (2021-03-31) * OK: winbuilder, x86_64-w64-mingw32 (64-bit), Windows, R version 4.1.2 (2021-11-01) -* OK: winbuilder, x86_64-w64-mingw32 (64-bit), Windows, R Under development (unstable) (2022-02-16 r81750 ucrt) +* OK: winbuilder, x86_64-w64-mingw32 (64-bit), Windows, R Under development (unstable) (2022-02-26 r81819 ucrt) * OK: rhub, Fedora Linux, R-devel, clang, gfortran * OK: rhub, Ubuntu Linux 20.04.1 LTS, R-release, GCC * OK: rhub, Windows Server 2022, R-devel, 64 bit +* OK: rhub, Debian Linux, R-devel, clang, ISO-8859-15 locale ## R CMD check results @@ -86,21 +33,8 @@ There was one NOTE in most test environments: ``` Maintainer: 'Alessandro Samuel-Rosa ' - -New submission - -Package was archived on CRAN - -CRAN repository db overrides: - X-CRAN-Comment: Archived on 2020-10-24 as problems were not corrected - in time. - - Including not using Suggests conditionally. ``` -This NOTE can be ignored. This release incorporates new functions that solve the errors found in the -CRAN check results on 2020-10-24. - ## Reverse dependencies There are no reverse dependencies.