r-tmap / r-tmap/tmap

Suggestion: sd style labels

Open
#509 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Legends
Dominant language
R
Stars
907
Forks
123
PR merge metrics
No merged PRs in 30d

Description

@mtennekes I have three ideas for improvement of the sd style. Let me know what you think about it.

  1. Automatic labels for this style (how much the values deviates from the mean) (see image at the bottom)
  2. Middle class containing the values around the mean (e.g. -0.5 sd to 0.5 sd). Right now, there are two middle class - one below and one above the mean.
  3. Automatic diverging palette when the sd style is used.
library(tmap)
library(spData)

mean(world$lifeExp, na.rm = TRUE)
#> [1] 70.85439
sd(world$lifeExp, na.rm = TRUE)
#> [1] 8.209522

tm_shape(world) +
  tm_polygons("lifeExp", style = "sd")
#> Linking to GEOS 3.8.1, GDAL 3.0.4, PROJ 6.3.2

Created on 2020-10-09 by the reprex package (v0.3.0)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing implementation of tm_polygons() with style = "sd". Clarify the intended behavior for automatic labels, a single middle class around the mean, and an automatic diverging palette before locating the relevant code and tests. Done means the agreed behavior is implemented and verified for the example using world$lifeExp.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.