Skip to content

Commit

Permalink
packaged accepted on CRAN (#6)
Browse files Browse the repository at this point in the history
* cran version - working draft

* headings enlarged to improve orientation

* level 3 instead of lvl. 2 heading

* heading working...

* Update README.md

* cleaning up readme

* manuals double checked to conform to sf format

* manuals triple checked, copyright updated in description

* links in description

* arcdata communication

* no longer depending on sf - one less note on CRAN

* cleaner description, correct translation of ORP in man, removed savviness map

* cran comments created

* data moved from local to remote storage

* local data removed

* redundant files removed from data-raw

* cleaing up cran-dev

* testing url existence + tests added

* reky working again

* manuals recrated

* tuning examples in obce_polygony (et all)

* roxygen in vignette

* roxygen in suggests (4 Travis)

* roxygen in travis, not DESCRIPTION

* unit tests updated: 1) existence 2) row count

* functions exported

* namespace working, examples not run

* non ascii chars removed from description

* description tuned

* description not starting by package name

* examples prepared, tuning one last warning

* RCzechia in vignette (instead of devtools::load_all)

* description amended as requested by Swetlana

* cran shields in package header
  • Loading branch information
jlacko authored Mar 5, 2018
1 parent 836f6b6 commit 690a97e
Show file tree
Hide file tree
Showing 39 changed files with 464 additions and 300,576 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ sudo: false
cache:
packages: yes

r_packages:
- testthat
- roxygen2

addons:
apt:
packages:
Expand Down
22 changes: 15 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
Package: RCzechia
Type: Package
Title: A Set of Spatial Objects Relevant to the Czech Republic
Version: 1.0.4
Date: 2018-02-25
Title: Spatial Objects of the Czech Republic
Version: 1.1.1
Date: 2018-03-02
Author: Jindra Lacko
Maintainer: Jindra Lacko <jindra.lacko@gmail.com>
Description: Administrative regions of the Czech Republic as sf data frames.
Description:
Administrative regions, rivers and water bodies of the Czech Republic. Based on <https://www.arcdata.cz/produkty/geograficka-data/arccr-500>, originally created in 2016.
URL: https://github.com/jlacko/RCzechia
BugReports: https://github.com/jlacko/RCzechia/issues
License: MIT + file LICENSE
Copyright: ArcCR, ARCDATA PRAHA, ZU, CSU, 2016
License:
MIT + file LICENSE
Copyright:
ArcCR, ARCDATA PRAHA, ZU, CSU, 2016
Encoding: UTF-8
LazyData: true
Depends:
R (>= 3.3.0)
Imports:
httr
Suggests:
tidyverse,
sf,
units,
tmap,
lwgeom,
ggmap,
knitr
knitr,
testthat,
roxygen2,
devtools
RoxygenNote: 6.0.1
VignetteBuilder: knitr
23 changes: 2 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
MIT License

Copyright (c) 2018 Jindra Lacko, (c) ArcCR, ARCDATA PRAHA, ZU, CSU, 2016

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
YEAR: 2018
COPYRIGHT HOLDER: Jindra Lacko
10 changes: 10 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# Generated by roxygen2: do not edit by hand

export(casti)
export(kraje)
export(obce_body)
export(obce_polygony)
export(okresy)
export(orp_polygony)
export(plochy)
export(reky)
export(republika)
importFrom(httr,http_error)
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version 1.0.4
- this is the the first CRAN version
version 1.1.1
- [!] this is the the first CRAN version
- [!] to make the package pass CRAN size requirements data files were changed from internal to external (internet connection required to load)
- a development version is available on https://github.com/jlacko/RCzechia
- if you have any questions or suggestions, please contact me (jindra dot lacko at gmail dot com)
28 changes: 24 additions & 4 deletions R/casti.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
#' Districts (mestske casti) of Prague and other major cities.
#' Districts of Prague and other major cities
#'
#' Due to package size constraints the data are stored externally (and a working internet connection is required to use the package). Downloaded size is 593.6 KB.
#'
#' casti() is a function taking no parameters and returning a data frame; remember to use (empty) brackets in your call.
#'
#' @format sf data frame with 142 rows of 4 variables + geometry
#'
#' @format 57 districts (mestske casti) of Prague, as a sf data frame:
#' \describe{
#' \item{KOD}{Code of the city part / kod mestske casti}
#' \item{NAZEV}{Name of the city part / nazev mestske casti}
#' \item{KOD_OBEC}{Code of the city}
#' \item{NAZ_OBEC}{Name of the city}
#' }
#' @source ArcČR 500
"casti"
#'
#' @source \url{https://www.arcdata.cz/produkty/geograficka-data/arccr-500}
#'
#'
#' @export
#' @importFrom httr http_error

casti <- function() {
remote_df <- 'http://rczechia.jla-data.net/casti.rds'
if (http_error(remote_df)) {
warning('No internet connection or data source broken.')
return(NA)
} else {
local_df <- readRDS(url(remote_df))
}
local_df
}
30 changes: 26 additions & 4 deletions R/kraje.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
#' Regions (kraje) of the Czech Republic. NUTS3 administrative unit for the Czech Republic.
#' Regions (kraje) of the Czech Republic
#'
#' NUTS3 administrative unit for the Czech Republic.
#'
#' Due to package size constraints the data are stored externally (and a working internet connection is required to use the package). Downloaded size is 2.9 MB (so use with caution, and patience).
#'
#' kraje() is a function taking no parameters and returning a data frame; remember to use (empty) brackets in your call.
#'
#' @format sf data frame with 14 rows of 3 variables + geometry
#'
#' @format 14 regions of the Czech Republic, as a sf data frame:
#' \describe{
#' \item{KOD_KRAJ}{Code of the region, primary key. Use this as key to add other data items.}
#' \item{KOD_CZNUTS3}{Code of the region as NUTS3 (kraj).}
#' \item{NAZ_CZNUTS3}{Name of the region as NUTS3 (kraj).}
#' }
#' @source ArcČR 500
"kraje"
#'
#' @source \url{https://www.arcdata.cz/produkty/geograficka-data/arccr-500}
#'
#'
#' @export
#' @importFrom httr http_error

kraje <- function() {
remote_df <- 'http://rczechia.jla-data.net/Kraje.rds'
if (http_error(remote_df)) {
warning('No internet connection or data source broken.')
return(NA)
} else {
local_df <- readRDS(url(remote_df))
}
local_df
}
33 changes: 28 additions & 5 deletions R/obce_body.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#' Municipalities / communes (obce) of the Czech Republic. LAU2 administrative unit for the Czech Republic.
#' Municipalities / communes (obce) as centerpoints
#'
#' LAU2 administrative unit for the Czech Republic.
#'
#' Due to package size constraints the data are stored externally (and a working internet connection is required to use the package). Downloaded size is 270 KB.
#'
#' obce_body() is a function taking no parameters and returning a data frame; remember to use (empty) brackets in your call.
#'
#' @format sf data frame with 6.258 rows of 14 variables + geometry
#'
#' @format 6.258 municipalities of the Czech Republic, as a sf data frame:
#' \describe{
#' \item{KOD_OBEC}{Code of the level I commune (obec).}
#' \item{NAZ_OBEC}{Name of the level I commune (obec).}
Expand All @@ -16,6 +23,22 @@
#' \item{KOD_KRAJ}{Code of the region (kraj).}
#' \item{KOD_CZNUTS2}{Code of the NUTS3 unit (kraj)}
#' \item{NAZ_CZNUTS2}{Name of the NUTS3 unit (kraj)}
#' }
#' @source ArcČR 500
"obce_body"
#' }
#'
#'
#' @source \url{https://www.arcdata.cz/produkty/geograficka-data/arccr-500}
#'
#'
#' @export
#' @importFrom httr http_error

obce_body <- function() {
remote_df <- 'http://rczechia.jla-data.net/ObceB.rds'
if (http_error(remote_df)) {
warning('No internet connection or data source broken.')
return(NA)
} else {
local_df <- readRDS(url(remote_df))
}
local_df
}
38 changes: 35 additions & 3 deletions R/obce_polygony.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#' Municipalities / communes (obce) of the Czech Republic. LAU2 administrative unit for the Czech Republic.
#' Municipalities / communes (obce) as polygons
#'
#' LAU2 administrative unit for the Czech Republic.
#'
#' Due to package size constraints the data are stored externally (and a working internet connection is required to use the package). Downloaded size is 36.3 MB (so use with caution, and patience).
#'
#' obce_polygony() is a function taking no parameters and returning a data frame; remember to use (empty) brackets in your call.
#'
#' @format sf data frame with 6.258 rows of 14 variables + geometry
#'
#' @format 6.258 municipalities of the Czech Republic, as a sf data frame:
#' \describe{
#' \item{KOD_OBEC}{Code of the level I commune (obec).}
#' \item{NAZ_OBEC}{Name of the level I commune (obec).}
Expand All @@ -17,4 +24,29 @@
#' \item{KOD_CZNUTS2}{Code of the NUTS3 unit (kraj)}
#' \item{NAZ_CZNUTS2}{Name of the NUTS3 unit (kraj)}
#' }
"obce_polygony"
#'
#'
#' @source \url{https://www.arcdata.cz/produkty/geograficka-data/arccr-500}
#'
#' @examples
#' \dontrun{
#' praha <- obce_polygony() %>%
#' filter(NAZ_LAU1 == "Praha")
#'
#' plot(praha, max.plot = 1)
#' }
#'
#'
#' @export
#' @importFrom httr http_error

obce_polygony <- function() {
remote_df <- 'http://rczechia.jla-data.net/ObceP.rds'
if (http_error(remote_df)) {
warning('No internet connection or data source broken.')
return(NA)
} else {
local_df <- readRDS(url(remote_df))
}
local_df
}
35 changes: 31 additions & 4 deletions R/okresy.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#' Districts (okresy) of the Czech Republic. LAU1 administrative unit for the Czech Republic.
#' Districts (okresy)
#'
#' LAU1 administrative unit for the Czech Republic.
#'
#' Due to package size constraints the data are stored externally (and a working internet connection is required to use the package). Downloaded size is 6.1 MB (so use with caution, and patience).
#'
#' okresy() is a function taking no parameters and returning a data frame; remember to use (empty) brackets in your call.
#'
#' @format sf data frame with 77 rows of 6 variables + geometry
#'
#' @format 77 districts of the Czech Republic, as a sf data frame:
#' \describe{
#' \item{KOD_OKRES}{Code of the district (okres).}
#' \item{KOD_LAU1}{Code of the district as LAU1 unit (okres), primary key. Use this as key to add other data items.}
Expand All @@ -9,5 +16,25 @@
#' \item{KOD_CZNUTS3}{Code of the region as NUTS3 (kraj).}
#' \item{NAZ_CZNUTS3}{Name of the region (kraj).}
#' }
#' @source ArcČR 500
"okresy"
#'
#' @source \url{https://www.arcdata.cz/produkty/geograficka-data/arccr-500}
#'
#' @examples
#' library(sf)
#'
#' hranice <- okresy()
#' plot(hranice, col = "white", max.plot = 1)
#'
#' @export
#' @importFrom httr http_error

okresy <- function() {
remote_df <- 'http://rczechia.jla-data.net/Okresy.rds'
if (http_error(remote_df)) {
warning('No internet connection or data source broken.')
return(NA)
} else {
local_df <- readRDS(url(remote_df))
}
local_df
}
29 changes: 25 additions & 4 deletions R/orp_polygony.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#' Municipalities with extended powers (obce s rozsirenou pusobnosti) of the Czech Republic
#' Municipalities with extended powers (obce s rozsirenou pusobnosti)
#'
#' Due to package size constraints the data are stored externally (and a working internet connection is required to use the package). Downloaded size is 9 MB (so use with caution, and patience).
#'
#' orp_polygony() is a function taking no parameters and returning a data frame; remember to use (empty) brackets in your call.
#'
#' @format sf data frame with 206 rows of 10 variables + geometry
#'
#' @format 205 municipalities with extended powers of the Czech Republic , as a sf data frame:
#' \describe{
#' \item{KOD_ORP}{Code of the level III commune (obec s rozsirenou pusobnosti).}
#' \item{NAZ_ZKR_ORP}{Short name of the level III commune (obec s rozsirenou pusobnosti).}
Expand All @@ -14,5 +19,21 @@
#' \item{KOD_CZNUTS2}{Code of the NUTS3 unit (kraj)}
#' \item{NAZ_CZNUTS2}{Name of the NUTS3 unit (kraj)}
#' }
#' @source ArcČR 500
"orp_polygony"
#'
#'
#' @source \url{https://www.arcdata.cz/produkty/geograficka-data/arccr-500}
#'
#'
#' @export
#' @importFrom httr http_error

orp_polygony <- function() {
remote_df <- 'http://rczechia.jla-data.net/ORP.rds'
if (http_error(remote_df)) {
warning('No internet connection or data source broken.')
return(NA)
} else {
local_df <- readRDS(url(remote_df))
}
local_df
}
27 changes: 24 additions & 3 deletions R/plochy.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
#' Water bodies (vodni plochy) of the Czech Republic
#' Water bodies of the Czech Republic
#'
#' Due to package size constraints the data are stored externally (and a working internet connection is required to use the package). Downloaded size is 118.6 KB.
#'
#' plochy() is a function taking no parameters and returning a data frame; remember to use (empty) brackets in your call.
#'
#' @format sf data frame with 480 rows of 5 variables + geometry
#'
#' @format 480 water bodies of the Czech Repubic, as a sf data frame:
#' \describe{
#' \item{TYP}{Type of water body: 1 = dam, 2 = pond, 3 = lake}
#' \item{NAZEV}{Name, with Czech accents}
#' \item{NAZEV_ASCII}{Name, without Czech accents}
#' \item{VYSKA}{water level, meters above sea level}
#' \item{Major}{Boolean indicating the major water bodies}
#' }
"plochy"
#'
#' @source \url{https://www.arcdata.cz/produkty/geograficka-data/arccr-500}
#'
#'
#' @export
#' @importFrom httr http_error

plochy <- function() {
remote_df <- 'http://rczechia.jla-data.net/Plochy.rds'
if (http_error(remote_df)) {
warning('No internet connection or data source broken.')
return(NA)
} else {
local_df <- readRDS(url(remote_df))
}
local_df
}
Loading

0 comments on commit 690a97e

Please sign in to comment.