Skip to content

Commit 7fa67a3

Browse files
committed
v1.8.2
1 parent e375fdc commit 7fa67a3

File tree

6 files changed

+27
-28
lines changed

6 files changed

+27
-28
lines changed

r-package/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: geobr
33
Title: Download Official Spatial Data Sets of Brazil
4-
Version: 1.8.999
4+
Version: 1.8.2
55
Authors@R: c(person(given="Rafael H. M.", family="Pereira", email="rafa.pereira.br@gmail.com", role=c("aut", "cre"), comment = c(ORCID = "0000-0003-2125-7465")),
66
person(given="Caio Nogueira", family="Goncalves", role=c("aut")),
77
person(given="Paulo Henrique Fernandes de", family="Araujo", role=c("ctb")),

r-package/NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# geobr v1.8.999 dev
1+
# geobr v1.8.2
22

33
**CRAN request**
4-
- Fixed issue to nake sure geobr uses suggested packages conditionally
4+
- Fixed issue to make sure geobr uses suggested packages conditionally
55

66
**Minor changes**
77
- Fixed non-ASCII characters in data `geobr::grid_state_correspondence_table()`

r-package/cran-comments.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
── R CMD check results ─────────────────────────────────────────────────────────────────────────────── geobr 1.8.1 ────
2-
Duration: 7m 49.9s
1+
── R CMD check results ────────────────────────────────────────────────── geobr 1.8.2 ────
2+
Duration: 6m 47.4s
33

4-
❯ checking data for non-ASCII characters ... NOTE
5-
Note: found 58 marked UTF-8 strings
4+
0 errors ✔ | 0 warnings ✔ | 0 notes ✔
65

7-
0 errors ✔ | 0 warnings ✔ | 1 note ✖
86

97

10-
* geobr now uses suggested packages conditionally
8+
**CRAN request**
9+
- Fixed issue to make sure geobr uses suggested packages conditionally on CRAN
10+
11+
**Minor changes**
12+
- Fixed non-ASCII characters in data `geobr::grid_state_correspondence_table()`
1113

r-package/man/geobr.Rd

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

r-package/tests/tests_rafa/test_rafa.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,9 @@ rhub::check_for_cran(show_status = FALSE)
554554
# submit to CRAN -----------------
555555
usethis::use_cran_comments('teste 2222, , asdadsad')
556556

557-
1
557+
devtools::submit_cran()
558+
559+
558560

559561

560562
# build binary --------------------------------

r-package/vignettes/intro_to_geobr.Rmd

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ knitr::opts_chunk$set(
1616
)
1717
1818
19-
use_suggested_pkgs <- c((requireNamespace("dplyr")),
20-
(requireNamespace("scales")),
21-
(requireNamespace("ggplot2")),
22-
(requireNamespace("censobr")))
23-
24-
use_suggested_pkgs <- all(use_suggested_pkgs)
2519
```
2620

2721

@@ -44,7 +38,7 @@ devtools::install_github("ipeaGIT/geobr", subdir = "r-package")
4438

4539
Now let's load the libraries we'll use in this vignette.
4640

47-
```{r eval=use_suggested_pkgs, message=FALSE, warning=FALSE, results='hide'}
41+
```{r message=FALSE, warning=FALSE, results='hide'}
4842
library(geobr)
4943
library(ggplot2)
5044
library(sf)
@@ -59,7 +53,7 @@ library(dplyr)
5953

6054
The geobr package covers 27 spatial data sets, including a variety of political-administrative and statistical areas used in Brazil. You can view what data sets are available using the `list_geobr()` function.
6155

62-
```{r eval=use_suggested_pkgs, message=FALSE, warning=FALSE}
56+
```{r message=FALSE, warning=FALSE}
6357
# Available data sets
6458
datasets <- list_geobr()
6559
@@ -73,7 +67,7 @@ head(datasets)
7367
The syntax of all *geobr* functions operate one the same logic, so the code to download the data becomes intuitive for the user. Here are a few examples.
7468

7569
Download an specific geographic area at a given year
76-
```{r eval=use_suggested_pkgs, message=FALSE, warning=FALSE}
70+
```{r message=FALSE, warning=FALSE}
7771
# State of Sergige
7872
state <- read_state(
7973
code_state="SE",
@@ -95,7 +89,7 @@ ggplot() +
9589

9690

9791
Download all geographic areas within a state at a given year
98-
```{r eval=use_suggested_pkgs, message=FALSE, warning=FALSE, results='hide'}
92+
```{r message=FALSE, warning=FALSE, results='hide'}
9993
# All municipalities in the state of Minas Gerais
10094
muni <- read_municipality(code_muni = "MG",
10195
year = 2007,
@@ -113,7 +107,7 @@ head(muni)
113107

114108
If the parameter `code_` is not passed to the function, geobr returns the data for the whole country by default.
115109

116-
```{r eval=use_suggested_pkgs, message=FALSE, warning=FALSE}
110+
```{r message=FALSE, warning=FALSE}
117111
# read all intermediate regions
118112
inter <- read_intermediate_region(
119113
year = 2017,
@@ -141,7 +135,7 @@ All functions to download polygon data such as states, municipalities etc. have
141135

142136
Once you've downloaded the data, it is really simple to plot maps using `ggplot2`.
143137

144-
```{r eval=use_suggested_pkgs, message=FALSE, warning=FALSE, fig.height = 8, fig.width = 8, fig.align = "center"}
138+
```{r message=FALSE, warning=FALSE, fig.height = 8, fig.width = 8, fig.align = "center"}
145139
# Remove plot axis
146140
no_axis <- theme(axis.title=element_blank(),
147141
axis.text=element_blank(),
@@ -160,7 +154,7 @@ ggplot() +
160154

161155
Plot all the municipalities of a particular state, such as Rio de Janeiro:
162156

163-
```{r eval=use_suggested_pkgs, message=FALSE, warning=FALSE, fig.height = 8, fig.width = 8, fig.align = "center"}
157+
```{r message=FALSE, warning=FALSE, fig.height = 8, fig.width = 8, fig.align = "center"}
164158
165159
# Download all municipalities of Rio
166160
all_muni <- read_municipality(
@@ -187,7 +181,7 @@ The next step is to combine data from ***geobr*** package with other data sets
187181

188182
First, we need a `data.frame` with estimates of Life Expectancy and merge it to our spatial database. The two-digit abbreviation of state name is our key column to join these two databases.
189183

190-
```{r eval=use_suggested_pkgs, message=FALSE, warning=FALSE, results='hide'}
184+
```{r message=FALSE, warning=FALSE, results='hide'}
191185
# Read data.frame with life expectancy data
192186
df <- utils::read.csv(system.file("extdata/br_states_lifexpect2017.csv", package = "geobr"), encoding = "UTF-8")
193187
@@ -202,7 +196,7 @@ states <- dplyr::left_join(states, df, by = c("name_state" = "uf"))
202196

203197
#### Plot thematic map
204198

205-
```{r eval=use_suggested_pkgs, message=FALSE, warning=FALSE, fig.height = 8, fig.width = 8, fig.align = "center" }
199+
```{r message=FALSE, warning=FALSE, fig.height = 8, fig.width = 8, fig.align = "center" }
206200
ggplot() +
207201
geom_sf(data=states, aes(fill=ESPVIDA2017), color= NA, size=.15) +
208202
labs(subtitle="Life Expectancy at birth, Brazilian States, 2014", size=8) +
@@ -220,7 +214,7 @@ First, we need to download households data from the Brazilian census using the `
220214

221215

222216

223-
```{r, eval = use_suggested_pkgs }
217+
```{r}
224218
library(censobr)
225219
226220
hs <- read_households(year = 2010,
@@ -230,7 +224,7 @@ hs <- read_households(year = 2010,
230224

231225
Now we're going to (a) group observations by municipality, (b) get the number of households connected to a sewage network, (c) calculate the proportion of households connected, and (d) collect the results.
232226

233-
```{r, eval = use_suggested_pkgs, warning = FALSE}
227+
```{r, warning = FALSE}
234228
esg <- hs |>
235229
collect() |>
236230
group_by(code_muni) |> # (a)
@@ -243,7 +237,7 @@ head(esg)
243237
```
244238
Now we only need to download the geometries of Brazilian municipalities from **geobr**, merge the spatial data with our estimates and map the results.
245239

246-
```{r, eval = use_suggested_pkgs, warning = FALSE}
240+
```{r, warning = FALSE}
247241
# download municipality geometries
248242
muni_sf <- geobr::read_municipality(year = 2010,
249243
showProgress = FALSE)

0 commit comments

Comments
 (0)