Skip to content

Commit b8bcb27

Browse files
committed
Compress external data
1 parent 1a0a673 commit b8bcb27

32 files changed

+65
-57
lines changed

CITATION.cff

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ preferred-citation:
3333
abstract: Extension of the tidyverse for SpatRaster and SpatVector objects of the
3434
terra package. It includes also new geom_ functions that provide a convenient
3535
way of visualizing terra objects with ggplot2.
36+
repository: https://CRAN.R-project.org/package=tidyterra
3637
repository-code: https://github.com/dieghernan/tidyterra
3738
url: https://dieghernan.github.io/tidyterra/
3839
contact:
@@ -73,7 +74,6 @@ references:
7374
given-names: Gábor
7475
email: csardi.gabor@gmail.com
7576
year: '2022'
76-
url: https://CRAN.R-project.org/package=cli
7777
version: '>= 3.0.0'
7878
- type: software
7979
title: crayon
@@ -84,7 +84,7 @@ references:
8484
given-names: Gábor
8585
email: csardi.gabor@gmail.com
8686
year: '2022'
87-
url: https://CRAN.R-project.org/package=crayon
87+
url: https://github.com/r-lib/crayon#readme
8888
- type: software
8989
title: data.table
9090
abstract: 'data.table: Extension of `data.frame`'
@@ -97,7 +97,6 @@ references:
9797
given-names: Arun
9898
email: asrini@pm.me
9999
year: '2022'
100-
url: https://CRAN.R-project.org/package=data.table
101100
- type: software
102101
title: dplyr
103102
abstract: 'dplyr: A Grammar of Data Manipulation'
@@ -116,7 +115,6 @@ references:
116115
given-names: Kirill
117116
orcid: https://orcid.org/0000-0002-1416-3412
118117
year: '2022'
119-
url: https://CRAN.R-project.org/package=dplyr
120118
version: '>= 1.0.0'
121119
- type: software
122120
title: ggplot2
@@ -151,7 +149,6 @@ references:
151149
given-names: Dewey
152150
orcid: https://orcid.org/0000-0002-9415-4582
153151
year: '2022'
154-
url: https://CRAN.R-project.org/package=ggplot2
155152
version: '>= 3.1.0'
156153
- type: software
157154
title: magrittr
@@ -165,7 +162,6 @@ references:
165162
given-names: Hadley
166163
email: hadley@rstudio.com
167164
year: '2022'
168-
url: https://CRAN.R-project.org/package=magrittr
169165
- type: software
170166
title: rlang
171167
abstract: 'rlang: Functions for Base Types and Core R and ''Tidyverse'' Features'
@@ -178,7 +174,6 @@ references:
178174
given-names: Hadley
179175
email: hadley@rstudio.com
180176
year: '2022'
181-
url: https://CRAN.R-project.org/package=rlang
182177
- type: software
183178
title: scales
184179
abstract: 'scales: Scale Functions for Visualization'
@@ -190,7 +185,6 @@ references:
190185
- family-names: Seidel
191186
given-names: Dana
192187
year: '2022'
193-
url: https://CRAN.R-project.org/package=scales
194188
- type: software
195189
title: sf
196190
abstract: 'sf: Simple Features for R'
@@ -201,7 +195,6 @@ references:
201195
email: edzer.pebesma@uni-muenster.de
202196
orcid: https://orcid.org/0000-0001-8049-7069
203197
year: '2022'
204-
url: https://CRAN.R-project.org/package=sf
205198
version: '>= 1.0.0'
206199
- type: software
207200
title: terra
@@ -213,7 +206,7 @@ references:
213206
email: r.hijmans@gmail.com
214207
orcid: https://orcid.org/0000-0001-5872-2872
215208
year: '2022'
216-
url: https://CRAN.R-project.org/package=terra
209+
url: https://rspatial.org/terra/
217210
version: '>= 1.5-12'
218211
- type: software
219212
title: tibble
@@ -227,7 +220,6 @@ references:
227220
given-names: Hadley
228221
email: hadley@rstudio.com
229222
year: '2022'
230-
url: https://CRAN.R-project.org/package=tibble
231223
version: '>= 3.0.0'
232224
- type: software
233225
title: tidyr
@@ -240,7 +232,6 @@ references:
240232
- family-names: Girlich
241233
given-names: Maximilian
242234
year: '2022'
243-
url: https://CRAN.R-project.org/package=tidyr
244235
version: '>= 1.0.0'
245236
- type: software
246237
title: isoband
@@ -257,7 +248,7 @@ references:
257248
email: thomasp85@gmail.com
258249
orcid: https://orcid.org/0000-0002-5147-4711
259250
year: '2022'
260-
url: https://CRAN.R-project.org/package=isoband
251+
url: https://wilkelab.org/isoband/
261252
- type: software
262253
title: knitr
263254
abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R'
@@ -268,7 +259,7 @@ references:
268259
email: xie@yihui.name
269260
orcid: https://orcid.org/0000-0003-0645-5666
270261
year: '2022'
271-
url: https://CRAN.R-project.org/package=knitr
262+
url: https://yihui.org/knitr/
272263
- type: software
273264
title: lifecycle
274265
abstract: 'lifecycle: Manage the Life Cycle of your Package Functions'
@@ -282,7 +273,6 @@ references:
282273
email: hadley@rstudio.com
283274
orcid: https://orcid.org/0000-0003-4757-117X
284275
year: '2022'
285-
url: https://CRAN.R-project.org/package=lifecycle
286276
- type: software
287277
title: maptiles
288278
abstract: 'maptiles: Download and Display Map Tiles'
@@ -293,7 +283,7 @@ references:
293283
email: timothee.giraud@cnrs.fr
294284
orcid: https://orcid.org/0000-0002-1932-3323
295285
year: '2022'
296-
url: https://CRAN.R-project.org/package=maptiles
286+
url: https://github.com/riatelab/maptiles/
297287
- type: software
298288
title: rmarkdown
299289
abstract: 'rmarkdown: Dynamic Documents for R'
@@ -332,7 +322,6 @@ references:
332322
email: rich@rstudio.com
333323
orcid: https://orcid.org/0000-0003-3925-190X
334324
year: '2022'
335-
url: https://CRAN.R-project.org/package=rmarkdown
336325
- type: software
337326
title: s2
338327
abstract: 's2: Spherical Geometry Operators Using the S2 Geometry Library'
@@ -350,7 +339,6 @@ references:
350339
given-names: Ege
351340
email: rubak@math.aau.dk
352341
year: '2022'
353-
url: https://CRAN.R-project.org/package=s2
354342
- type: software
355343
title: testthat
356344
abstract: 'testthat: Unit Testing for R'
@@ -360,7 +348,6 @@ references:
360348
given-names: Hadley
361349
email: hadley@rstudio.com
362350
year: '2022'
363-
url: https://CRAN.R-project.org/package=testthat
364351
version: '>= 3.0.0'
365352
- type: software
366353
title: tidyverse
@@ -371,7 +358,6 @@ references:
371358
given-names: Hadley
372359
email: hadley@rstudio.com
373360
year: '2022'
374-
url: https://CRAN.R-project.org/package=tidyverse
375361
- type: software
376362
title: vdiffr
377363
abstract: 'vdiffr: Visual Regression Testing and Graphical Diffing'
@@ -394,4 +380,3 @@ references:
394380
given-names: Vaudor
395381
email: lise.vaudor@ens-lyon.fr
396382
year: '2022'
397-
url: https://CRAN.R-project.org/package=vdiffr

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
- Add new function `stat_spatraster()`.
1919

20+
- Reduce the size of external files.
21+
2022
# tidyterra 0.2.2
2123

2224
- Changes on how **dplyr**, **tibble** and **tidyr** are attached. Now these

R/as_tibble.Spat.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#' @seealso [tibble::as_tibble()], [terra::as.data.frame()]
3232
#'
3333
#' @family coerce
34+
#' @family tibble.methods
3435
#'
3536
#' @section terra equivalent:
3637
#'

R/sysdata.rda

-606 Bytes
Binary file not shown.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ install.packages("tidyterra")
9898
You can install the development version of {tidyterra} like so:
9999

100100
``` r
101+
101102
remotes::install_github("dieghernan/tidyterra")
102103
```
103104

@@ -147,6 +148,7 @@ ggplot() +
147148

148149
``` r
149150

151+
150152
# Create maximum differences
151153

152154
variation <- rastertemp %>%
@@ -182,6 +184,7 @@ ggplot() +
182184
{ggplot2}
183185

184186
``` r
187+
185188
f_tile <- system.file("extdata/cyl_tile.tif", package = "tidyterra")
186189

187190
rgb_tile <- rast(f_tile)
@@ -196,6 +199,7 @@ ggplot() +
196199
<img src="https://raw.githubusercontent.com/dieghernan/tidyterra/main/img/README-example-tile-1.png" width="100%" />
197200

198201
``` r
202+
199203
# Recognizes coord_sf()
200204

201205
ggplot() +
@@ -212,6 +216,7 @@ ggplot() +
212216
{ggplot2}:
213217

214218
``` r
219+
215220
asia <- rast(system.file("extdata/asia.tif", package = "tidyterra"))
216221

217222
terra::plot(asia)
@@ -220,6 +225,7 @@ terra::plot(asia)
220225
<img src="https://raw.githubusercontent.com/dieghernan/tidyterra/main/img/README-hypso-1.png" width="100%" />
221226

222227
``` r
228+
223229
ggplot() +
224230
geom_spatraster(data = asia) +
225231
scale_fill_hypso_tint_c(

codemeta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"name": "R",
1515
"url": "https://r-project.org"
1616
},
17-
"runtimePlatform": "R version 4.2.1 (2022-06-23 ucrt)",
17+
"runtimePlatform": "R version 4.2.1 (2022-06-23)",
1818
"author": [
1919
{
2020
"@type": "Person",
@@ -325,7 +325,7 @@
325325
},
326326
"SystemRequirements": null
327327
},
328-
"fileSize": "3291.684KB",
328+
"fileSize": "2868.418KB",
329329
"citation": [
330330
{
331331
"@type": "SoftwareSourceCode",

data-raw/asia.R

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,35 @@
44
asiaraw <- terra::rast("data-raw/asia.tif")
55
template <- terra::project(asiaraw, "epsg:3857")
66
terra::ncell(template)
7-
template <- terra::spatSample(template, 250000, method = "regular", as.raster = TRUE)
7+
template <- terra::spatSample(template, 100000, method = "regular", as.raster = TRUE)
88
terra::ncell(template)
9-
10-
asia <- terra::project(asiaraw, template)
9+
asia <- terra::project(asiaraw, template, method = "cubic")
10+
asiaraw
11+
asia
1112

1213
terra::plot(asia)
1314

1415
devtools::load_all()
15-
# library(ggplot2)
16-
#
17-
# ggplot() +
18-
# geom_spatraster(data=asia) +
19-
# scale_fill_cpt_city_c(palette = "etopo1", as_tint = TRUE)
16+
library(ggplot2)
17+
18+
ggplot() +
19+
geom_spatraster(data = asia) +
20+
scale_fill_hypso_tint_c(
21+
palette = "gmt_globe",
22+
labels = scales::label_number(),
23+
breaks = c(-10000, -5000, 0, 2500, 5000, 8000),
24+
guide = guide_colorbar(
25+
direction = "horizontal",
26+
title.position = "top",
27+
barwidth = 20
28+
)
29+
) +
30+
labs(
31+
fill = "elevation (m)",
32+
title = "Hypsometric map of Asia"
33+
) +
34+
theme_minimal() +
35+
theme(legend.position = "bottom")
2036

2137
unlink("inst/extdata/asia.tif")
2238
terra::writeRaster(asia, "inst/extdata/asia.tif")

data-raw/cyl-gpkg.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ ggplot() +
9696
library(maptiles)
9797

9898
cyl_sf <- st_as_sf(cyl) %>% st_transform(3857)
99-
tile <- get_tiles(cyl_sf, crop = TRUE)
99+
sf::st_crs(cyl_sf)
100+
tile <- get_tiles(cyl_sf, crop = TRUE, verbose = TRUE, zoom = 7)
101+
terra::plotRGB(tile)
100102

101103
unlink("inst/extdata/cyl_tile.tif")
102104
writeRaster(tile, "inst/extdata/cyl_tile.tif")
11 Bytes
Binary file not shown.

data/hypsometric_tints_db.rda

-1.08 KB
Binary file not shown.

img/README-example-temp-1.png

287 Bytes
Loading

img/README-example-temp-2.png

-688 Bytes
Loading

img/README-example-tile-1.png

443 Bytes
Loading

img/README-example-tile-2.png

386 Bytes
Loading

img/README-hypso-1.png

-153 KB
Loading

img/README-hypso-2.png

-312 KB
Loading

inst/extdata/asia.tif

-685 KB
Binary file not shown.

inst/schemaorg.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,14 @@
2828
],
2929
"description": "Extension of the 'tidyverse' for 'SpatRaster' and 'SpatVector' objects of the 'terra' package. It includes also new 'geom_' functions that provide a convenient way of visualizing 'terra' objects with 'ggplot2'.",
3030
"license": "https://spdx.org/licenses/MIT",
31-
"name": "tidyterra: 'tidyverse' Methods and 'ggplot2' Utils for 'terra' Objects",
31+
"name": "tidyterra: 'tidyverse' Methods and 'ggplot2' Helpers for 'terra' Objects",
3232
"programmingLanguage": {
3333
"type": "ComputerLanguage",
3434
"name": "R",
3535
"url": "https://r-project.org"
3636
},
37-
"provider": {
38-
"id": "https://cran.r-project.org",
39-
"type": "Organization",
40-
"name": "Comprehensive R Archive Network (CRAN)",
41-
"url": "https://cran.r-project.org"
42-
},
43-
"runtimePlatform": "R version 4.2.0 (2022-04-22)",
44-
"version": "0.2.1.9000"
37+
"runtimePlatform": "R version 4.2.1 (2022-06-23)",
38+
"version": "0.3.0"
4539
},
4640
{
4741
"id": "https://doi.org/10.5281/zenodo.6572471",
@@ -51,7 +45,7 @@
5145
"familyName": "Hernangómez",
5246
"givenName": "Diego"
5347
},
54-
"name": "{tidyterra}: tidyverse Methods and ggplot2 Utils for terra Objects"
48+
"name": "{tidyterra}: tidyverse Methods and ggplot2 Helpers for terra Objects"
5549
}
5650
]
5751
}

man/as_tibble.Spat.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.

man/roxygen/meta.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
list(
22
rd_family_title = list(
33
coerce = "Coercing objects:",
4+
tibble.methods = "Other tibble methods:",
45
dplyr.methods = "Other dplyr methods:",
56
tidyr.method = "Other tidyr methods:",
67
ggplot2.utils = "Other ggplot2 utils:",

0 commit comments

Comments
 (0)