这是indexloc提供的服务,不要输入任何密码
Skip to content

Add test for #758 #759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
```