-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME.Rmd
More file actions
79 lines (63 loc) · 2.54 KB
/
Copy pathREADME.Rmd
File metadata and controls
79 lines (63 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
output: github_document
editor_options:
chunk_output_type: console
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
out.width = "100%",
dpi = 300,
fig.width = 7.2916667,
comment = "#>",
fig.path = "man/figures/README-"
)
hook_output <- knitr::knit_hooks$get("output")
knitr::knit_hooks$set(output = function(x, options) {
lines <- options$output.lines
if (is.null(lines)) {
return(hook_output(x, options)) # pass to default hook
}
x <- unlist(strsplit(x, "\n"))
more <- "..."
if (length(lines)==1) { # first n lines
if (length(x) > lines) {
# truncate the output, but add ....
x <- c(head(x, lines), more)
}
} else {
x <- c(more, x[lines], more)
}
# paste these lines together
x <- paste(c(x, ""), collapse = "\n")
hook_output(x, options)
})
```
# tmap.cartogram: cartograms in tmap <img src="man/figures/logo.png" align="right" height="139" alt="" />
<!-- badges: start -->
[](https://github.com/r-tmap/tmap/actions/workflows/R-CMD-check.yaml)
[](https://cran.r-project.org/package=tmap.cartogram)
[](https://cran.r-project.org/web/checks/check_results_tmap.cartogram.html)
[](https://www.r-pkg.org:443/pkg/tmap.cartogram)
[](https://www.gnu.org/licenses/gpl-3.0.html)
[](https://r-tmap.r-universe.dev/tmap.cartogram)
<!-- badges: end -->
Provides new layer functions for **tmap** to create various types of cartograms.
## Installation
Installation of **tmap.cartogram** is straightforward:
```{r eval=FALSE}
install.packages("tmap.cartogram")
```
### Development version
```{r eval=FALSE}
# install.packages("remotes")
remotes::install_github("r-tmap/tmap.cartogram")
# On Linux, with pak
# install.packages("pak")
pak::pak("r-tmap/tmap.cartogram")
# Or from r-universe
install.packages("tmap.cartogram", repos = c("https://r-tmap.r-universe.dev", "https://cloud.r-project.org"))
```
For the development version, it is also recommended to install the development version of [tmap](https://r-tmap.github.io/tmap/) as well.
## Getting started
See https://r-tmap.github.io/tmap.cartogram/articles/cartograms