Mapping lexical variation with Tableau software

This post is a short introduction to plotting choropleth maps with Tableau, a commercial data visualization software. I show how to plot such maps using the BBC Voices dataset.

Tableau software

In a previous post, I described how to plot data from the BNC 2014 with R. As is often the case with R, the procedure is definitely not beginner-friendly, but at least one gets to plot exactly what one wants exactly the way one wants.

Tableau is a commercial data visualization interface,1 not a programming interface. This means that if you are used to shaping data in R, you are likely to feel puzzled at first because its internal logic is different.

If you are allergic to R programming and want to plot elegant maps without going through the trouble of climbing a steep learning curve, Tableau is the way to go. Within minutes, one goes from loading a dataset to visualizing the results, and the palette of graphics is comprehensive.

The great asset of this Tableau is its mapping functionality. It can plot latitude and longitude coordinates and it handles most kinds of GIS-compatible spatial files (Esri Shapefiles, Keyhole Markup Language, and GeoJSON).

The BBC Voices data

Sadly, although the BNC 2014 contains information about speakers’ geographic origins, not all UK counties are represented, which means that the corpus is not suitable for a comprehensive study of linguistic variation.

We turn to another dataset: the BBC Voices survey dataset (more specifically the RADAR 1 part), which is based on the BBC Voices project. Access to RADAR 1 is restricted to the readers of Upton and Davies (2013). I do not own the rights and I cannot share the data.

The BBC Voices dataset is based on a survey in which about 734,000 responses from about 84,000 informants to 38 open-ended questions were collected. Each question is meant to elicit the variants of a lexical alternation. For example, the question what do you call a young person in cheap trendy clothes and jewellery? is intended to elicit such responses as chav, asbo, townie, scally, or ned. The table below shows a portion of the alternations and variants present in the BBC Voices survey dataset.2

Alternations Variants
To play truant Skive, bunk, wag, play hookey, skip 
Hit hard Whack, smack, thump, wallop, belt
Drunk Pissed, wasted
Pregnant Up the duff, pregnant, bun in the oven, expecting
Left-handed Cack-handed, left, cag-handed
Grandmother Nanny, granny, grandma
Grandfather Grandad, grandpa, grampa, pop
Young person in cheap trendy clothes and jewelery Chav, townie, scally, ned
Trousers Trousers, pants, keks, jeans, trews
Long soft seat in the main room Sofa, settee, couch
Toilet Loo, bog, toilet, lavatory
To rain lightly Drizzle, spit, shower
To rain heavily Pour, piss, chuck, bucket
Running water smaller than a river Stream, brook, burn beck

I am using the dataset as adapted by Grieve et al. (2019), which Jack Grieve has kindly agreed to share with me. Here is a snapshot (a random selection of 20 observations).

REGION  (postcode area)variant  (alternation)score (%)
BR  path  (Narrow walkway alongside buildings) 10.00
DH  well_off  (Rich) 9.52
LA  keks  (Trousers) 26.32
CB  nap  (Sleep) 21.83
HA  trews  (Trousers) 9.09
MK  baby  (Baby) 49.49
HX  pumps  (Child’s soft shoes worn for PE) 75.00
NG  expecting  (Pregnant) 9.25
chilly  (Cold) 12.38
BT  grandpa  (Grandfather) 8.31
WF  trainers  (Child’s soft shoes worn for PE) 10.26
NR  clobber  (Clothes) 17.91
AB  whack  (Hit hard) 12.98
BA  expecting  (Pregnant) 10.48
NP  nippy  (Cold) 8.11
NP  scally  (Young person in cheap trendy clothes…) 4.76
shattered  (Tired) 25.63
LA  fit  (Attractive) 62.07
TS  poorly  (Unwell) 49.47
SA  baby  (Baby) 51.76

Originally, the BBC Voices dataset provides the percentage of informants (third column) in 124 UK postcode areas (first column) who supplied each variant (second column). The percentages are based on the complete set of variants. In Grieve et al. (2019), the percentages were recalculated for each variant in each postcode area based only on the variants kept in the analysis.

Loading the data

The original data file is a comma-separated text file. It has one column for REGION, and one column per word (only the first 5 words are displayed below).

  REGION X01_baked X01_boiling X01_hot X01_roasting X01_sweating
1     AB      0.91       41.82   10.00        37.27         5.45
2     AL     15.69       50.98    5.88         7.84         9.80
3      B      8.09       59.27    5.48        12.01         7.31
4     BA      9.88       61.11    9.88         8.02         4.32
5     BB      2.80       53.27   10.28        20.56         9.35
6     BD      3.42       60.68    2.56        16.24         5.13

After reshaping the original file with tidyr, the data file now looks like this in R:

      REGION        word score
9877      PA          ma 18.52
2522      GY        lake  0.00
10476      L     grandma 18.03
14640     BL      settee 43.21
5202      WF bun_in_oven 13.64
12646     WV        gear  6.98
5854      DG        left 25.00
11316      E       buddy  1.56
14584     NP       couch  8.51
1777      GU        sick 36.51
11559     DH        mate 68.97
15613     UB      ginnel  3.03
2578      SO        lake  3.08
8682      AL       moody 33.33
7482      GY      mental  0.00
4996      EX      wasted 18.28
3313      RM         wag  6.67
12314     FY     clobber 22.73
9264      RH       bairn  5.33
8653      SN       mardy 38.71

As we inspect the structure of the dataset with R,

> str(data)
'data.frame':	17236 obs. of  3 variables:
 $ REGION: Factor w/ 124 levels "AB","AL","B",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ word  : Factor w/ 137 levels "alley","angry",..: 6 6 6 6 6 6 6 6 6 6 ...
 $ score : num  0.91 15.69 8.09 9.88 2.8 ...

we see that the 124 postcode areas are represented. There are 17236 observations and 137 word types.

Mapping the data with Tableau

Visit the Tableau website and install either the trial version or the student/instructor version.

Before you start, you need to download and install the UK Filled Map Geocoding Pack for Tableau provided by The Information Lab. Follow this video tutorial for easy install.

This is what Tableau looks like when no data has been loaded yet. To load data, click on Data Source in the lower left corner.

A blank Tableau worksheet

Alternatively, you may want to start from the home screen (which the Data Source link will take you to).

The Tableau home screen

Click on Text file and select the desired data file in the interactive window.

The data have been successfully imported

In the REGION column, click on ABC…

Then Geographic Role > UK Postcode Area

You can see that the REGION icon has changed. Tableau can now use the column data to retrieve longitudes and latitudes.

You may now click on Go to Worksheet. This takes to you where you can edit the data.

On the left, drag Word from Dimensions environment to the Columns environment. Drag Longitude (generated) from the Measures environment to the same Column environment. Drag Latitude (generated) to the Rows environment. Drag Score from the Measures environment to the Marks environment. Do the same for Region from Dimensions. Right now, this is what you should obtain.

Drag SUM(Score) to the Color box and Region to the Label box. This will create a set of choropleth maps (one for each word) with the postcode tags.

Finally, click on the arrow on the Word tab and activate Show Filter.

The filter feature allows the user to select which words should be plotted, knowing that one map per word is plotted. A window listing all the words appears to the right.

Suppose we want to compare the distributions of ned and chav. All we have to do is unselect all the words (leave All unchecked) and select the two words that we are interested in. Two maps are plotted: one for chav (left) and one for ned (right). The darker the shade of blue, the more specific a word is to an area. It appears that ned is specific to Scotland. Chav is used mostly in England and Wales.

The video below provides a recap of the above and shows how to fine-tune the maps.

References

Grieve, Jack and Montgomery, Chris and Nini, Andrea and Murakami, Akira and Guo, Diansheng (2019). Mapping Lexical Dialect Variation in British English Using Twitter. Frontiers in Artificial Intelligence 2

Upton, Clive, & Davies, Bethan. (Eds.). (2013). Analysing 21st century British English: Conceptual and methodological aspects of the ‘Voices’ project. Routledge.

Cite this article as: Guillaume Desagulier, "Mapping lexical variation with Tableau software," in Around the word, 03/11/2019, https://corpling.hypotheses.org/2853.
  1. However, free licenses are provided for students and instructors. []
  2. To see the full feature set, see Grieve et. al (2019: Table 1). []

Guillaume Desagulier

UMR 7114 MoDyCo — Université Paris 8, CNRS, Université Paris Nanterre, Institut Universitaire de France.

Vous aimerez aussi...

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.