Skip to content

Commit

Permalink
Send to cran
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Nov 9, 2022
1 parent e767ae4 commit 259a180
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 24 deletions.
26 changes: 21 additions & 5 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ references:
given-names: Gábor
email: [email protected]
year: '2022'
url: https://CRAN.R-project.org/package=cli
version: '>= 3.0.0'
- type: software
title: crayon
Expand All @@ -84,7 +85,7 @@ references:
given-names: Gábor
email: [email protected]
year: '2022'
url: https://github.com/r-lib/crayon#readme
url: https://CRAN.R-project.org/package=crayon
- type: software
title: data.table
abstract: 'data.table: Extension of `data.frame`'
Expand All @@ -97,6 +98,7 @@ references:
given-names: Arun
email: [email protected]
year: '2022'
url: https://CRAN.R-project.org/package=data.table
- type: software
title: dplyr
abstract: 'dplyr: A Grammar of Data Manipulation'
Expand All @@ -115,6 +117,7 @@ references:
given-names: Kirill
orcid: https://orcid.org/0000-0002-1416-3412
year: '2022'
url: https://CRAN.R-project.org/package=dplyr
version: '>= 1.0.0'
- type: software
title: ggplot2
Expand Down Expand Up @@ -149,6 +152,7 @@ references:
given-names: Dewey
orcid: https://orcid.org/0000-0002-9415-4582
year: '2022'
url: https://CRAN.R-project.org/package=ggplot2
version: '>= 3.1.0'
- type: software
title: magrittr
Expand All @@ -162,6 +166,7 @@ references:
given-names: Hadley
email: [email protected]
year: '2022'
url: https://CRAN.R-project.org/package=magrittr
- type: software
title: rlang
abstract: 'rlang: Functions for Base Types and Core R and ''Tidyverse'' Features'
Expand All @@ -174,6 +179,7 @@ references:
given-names: Hadley
email: [email protected]
year: '2022'
url: https://CRAN.R-project.org/package=rlang
- type: software
title: scales
abstract: 'scales: Scale Functions for Visualization'
Expand All @@ -185,6 +191,7 @@ references:
- family-names: Seidel
given-names: Dana
year: '2022'
url: https://CRAN.R-project.org/package=scales
- type: software
title: sf
abstract: 'sf: Simple Features for R'
Expand All @@ -195,6 +202,7 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0001-8049-7069
year: '2022'
url: https://CRAN.R-project.org/package=sf
version: '>= 1.0.0'
- type: software
title: terra
Expand All @@ -206,7 +214,7 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0001-5872-2872
year: '2022'
url: https://rspatial.org/terra/
url: https://CRAN.R-project.org/package=terra
version: '>= 1.5-12'
- type: software
title: tibble
Expand All @@ -220,6 +228,7 @@ references:
given-names: Hadley
email: [email protected]
year: '2022'
url: https://CRAN.R-project.org/package=tibble
version: '>= 3.0.0'
- type: software
title: tidyr
Expand All @@ -232,6 +241,7 @@ references:
- family-names: Girlich
given-names: Maximilian
year: '2022'
url: https://CRAN.R-project.org/package=tidyr
version: '>= 1.0.0'
- type: software
title: isoband
Expand All @@ -248,7 +258,7 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0002-5147-4711
year: '2022'
url: https://wilkelab.org/isoband/
url: https://CRAN.R-project.org/package=isoband
- type: software
title: knitr
abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R'
Expand All @@ -259,7 +269,7 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0003-0645-5666
year: '2022'
url: https://yihui.org/knitr/
url: https://CRAN.R-project.org/package=knitr
- type: software
title: lifecycle
abstract: 'lifecycle: Manage the Life Cycle of your Package Functions'
Expand All @@ -273,6 +283,7 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0003-4757-117X
year: '2022'
url: https://CRAN.R-project.org/package=lifecycle
- type: software
title: maptiles
abstract: 'maptiles: Download and Display Map Tiles'
Expand All @@ -283,7 +294,7 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0002-1932-3323
year: '2022'
url: https://github.com/riatelab/maptiles/
url: https://CRAN.R-project.org/package=maptiles
- type: software
title: rmarkdown
abstract: 'rmarkdown: Dynamic Documents for R'
Expand Down Expand Up @@ -322,6 +333,7 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0003-3925-190X
year: '2022'
url: https://CRAN.R-project.org/package=rmarkdown
- type: software
title: s2
abstract: 's2: Spherical Geometry Operators Using the S2 Geometry Library'
Expand All @@ -339,6 +351,7 @@ references:
given-names: Ege
email: [email protected]
year: '2022'
url: https://CRAN.R-project.org/package=s2
- type: software
title: testthat
abstract: 'testthat: Unit Testing for R'
Expand All @@ -348,6 +361,7 @@ references:
given-names: Hadley
email: [email protected]
year: '2022'
url: https://CRAN.R-project.org/package=testthat
version: '>= 3.0.0'
- type: software
title: tidyverse
Expand All @@ -358,6 +372,7 @@ references:
given-names: Hadley
email: [email protected]
year: '2022'
url: https://CRAN.R-project.org/package=tidyverse
- type: software
title: vdiffr
abstract: 'vdiffr: Visual Regression Testing and Graphical Diffing'
Expand All @@ -380,3 +395,4 @@ references:
given-names: Vaudor
email: [email protected]
year: '2022'
url: https://CRAN.R-project.org/package=vdiffr
30 changes: 12 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ objects with [{ggplot2}](https://ggplot2.tidyverse.org/).
{tidyverse} methods implemented on {tidyterra} works differently
depending on the type of Spat\* object:

- SpatVector: the methods are implemented taking advantage of the
tidyverse implementation on {sf}. The SpatVector object is converted
first to sf via `sf::st_as_sf()`, then the method (or function) is
applied and finally the object is converted back to SpatVector with
`terra::vect()`. Hence, rows correspond to geometries and columns
correspond to attributes of the geometry.

- SpatRaster: The implementation on SpatRaster objects differs, since
the methods could be applied to layers or to cells. {tidyterra}
overall approach is to treat the layers as columns of a tibble and the
cells as rows (i.e. `select(SpatRaster, 1)` would select the first
layer of a SpatRaster).
- SpatVector: the methods are implemented taking advantage of the
tidyverse implementation on {sf}. The SpatVector object is converted
first to sf via `sf::st_as_sf()`, then the method (or function) is
applied and finally the object is converted back to SpatVector with
`terra::vect()`. Hence, rows correspond to geometries and columns
correspond to attributes of the geometry.

- SpatRaster: The implementation on SpatRaster objects differs, since
the methods could be applied to layers or to cells. {tidyterra}
overall approach is to treat the layers as columns of a tibble and
the cells as rows (i.e. `select(SpatRaster, 1)` would select the
first layer of a SpatRaster).

The methods implemented return the same type of object used as input,
unless the expected behavior of the method is to return another type of
Expand Down Expand Up @@ -100,7 +100,6 @@ install.packages("tidyterra")
You can install the development version of {tidyterra} like so:

``` r

remotes::install_github("dieghernan/tidyterra")
```

Expand Down Expand Up @@ -150,7 +149,6 @@ ggplot() +

``` r


# Create maximum differences

variation <- rastertemp %>%
Expand Down Expand Up @@ -186,7 +184,6 @@ ggplot(prov) +
{ggplot2}

``` r

f_tile <- system.file("extdata/cyl_tile.tif", package = "tidyterra")

rgb_tile <- rast(f_tile)
Expand All @@ -204,7 +201,6 @@ plot
<img src="https://raw.githubusercontent.com/dieghernan/tidyterra/main/img/README-example-tile-1.png" width="100%" />

``` r

# Recognizes coord_sf()
plot +
# Change crs and datum (for relabeling graticules)
Expand All @@ -217,7 +213,6 @@ plot +
{ggplot2}:

``` r

asia <- rast(system.file("extdata/asia.tif", package = "tidyterra"))

terra::plot(asia)
Expand All @@ -226,7 +221,6 @@ terra::plot(asia)
<img src="https://raw.githubusercontent.com/dieghernan/tidyterra/main/img/README-hypso-1.png" width="100%" />

``` r

ggplot() +
geom_spatraster(data = asia) +
scale_fill_hypso_tint_c(
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
},
"SystemRequirements": null
},
"fileSize": "2553.946KB",
"fileSize": "2552.194KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down

0 comments on commit 259a180

Please sign in to comment.