From 10c6056acebfb7eadc165a9ca7f79a0b6e7f5d46 Mon Sep 17 00:00:00 2001 From: robinlovelace Date: Fri, 4 Aug 2023 21:00:27 +0100 Subject: [PATCH] Add test for #758 --- tests/testing_column_names_v4.Rmd | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/testing_column_names_v4.Rmd diff --git a/tests/testing_column_names_v4.Rmd b/tests/testing_column_names_v4.Rmd new file mode 100644 index 000000000..e4bd0b43e --- /dev/null +++ b/tests/testing_column_names_v4.Rmd @@ -0,0 +1,39 @@ +--- +title: "Testing - Column Names" +author: "Robin Lovelace" +date: "`r Sys.Date()`" +output: html_document +editor_options: + chunk_output_type: console +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE, fig.width = 9) +``` + +# Instructions + +Open the tmap repository as RStudio project. +Set Knit Directory (via drop-down menu of the Knit button in RStudio) to Project Directory. + +```{r echo=FALSE,message=FALSE,fig.height = 2} +library(devtools) +load_all() +data(World,metro,land) + +World$`Unusual column name` = World$HPI + +# Test in v4 (2023-08-4): +tm_shape(World) + + tm_polygons("Unusual column name") +# Error: Visual values used for the variable, "fill" of layer function "tm_polygons" are incorrect. + +# Test in v3: works! +remotes::install_version("tmap", version = "3.3") +detach("package:tmap", unload = TRUE) +library(tmap) + +World$`Unusual column name` = World$HPI +tm_shape(World) + + tm_polygons("Unusual column name") +```