# remotes::install_github("mtennekes/tmap")
library(tmap)
library(terra)
#> terra version 1.0.7
# 1 -----------------------------------------------------------------------
elev = rast(system.file("ex/elev.tif", package = "terra"))
tm_shape(elev) +
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| st_from_ellipses = function(path, crs = "EPSG:25832", res = 30) { | |
| e = read.csv(path) | |
| pnt = sf::st_as_sf(e, coords = c("X", "Y"), crs = crs) | |
| major = pnt$Major | |
| minor = pnt$Minor | |
| angle = pnt$Angle1 | |
| rotation = function(a){ | |
| r = a * pi / 180 #degrees to radians | |
| matrix(c(cos(r), sin(r), -sin(r), cos(r)), nrow = 2, ncol = 2) | |
| } |
library(tmap)
#> Warning: multiple methods tables found for 'area'
data(metro)
metro$group = as.factor(sample(1:5, size = nrow(metro), replace = TRUE))
# two legends
tm_shape(metro) +
tm_symbols(col = "group", shape = "group")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #' Flatten copy | |
| #' | |
| #' @param from Source directory path. | |
| #' @param to Destination directory path. | |
| #' | |
| #' @return Destination directory path. | |
| #' | |
| #' @details | |
| #' Copy all `.Rmd`, `.qmd`, and `.md` files from source to destination, | |
| #' rename the `.qmd` and `.md` files with an additional `.Rmd` extension, |
OlderNewer