Skip to content

Commit

Permalink
remove non-ASCII characters from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-rosa committed Feb 28, 2022
1 parent f09d6fa commit 526edef
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 90 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
33 changes: 18 additions & 15 deletions R/morphology.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]] <-
Expand All @@ -53,22 +52,24 @@ 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, ";")
# Dados sobre estrutura geralmente são o terceiro item da lista
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)) {
Expand All @@ -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])
Expand Down Expand Up @@ -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()
Expand All @@ -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)")
Expand All @@ -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()
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<!-- [![Build Status](https://travis-ci.org/samuel-rosa/febr-package.svg?branch=master)](https://travis-ci.org/samuel-rosa/febr-package) -->
[![CRAN](https://www.r-pkg.org/badges/version/febr)](https://cran.r-project.org/package=febr)
[![cran
Expand Down
5 changes: 4 additions & 1 deletion build-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ devtools::check_win_devel("febr-package/")
# check in R-hub ----
# rhub::validate_email(email = "[email protected]")
# 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()

Expand Down
76 changes: 5 additions & 71 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -86,21 +33,8 @@ There was one NOTE in most test environments:

```
Maintainer: 'Alessandro Samuel-Rosa <[email protected]>'
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.

0 comments on commit 526edef

Please sign in to comment.