Skip to content

Commit

Permalink
Merge pull request #759 from r-tmap/758-v4-fails-with-non-standard-co…
Browse files Browse the repository at this point in the history
…lumn-names

Add test for #758
  • Loading branch information
mtennekes authored Aug 13, 2023
2 parents 1a2b4a7 + 10c6056 commit a2b52fb
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/testing_column_names_v4.Rmd
Original file line number Diff line number Diff line change
@@ -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")
```

0 comments on commit a2b52fb

Please sign in to comment.