In this notebook, we will be using data from a 2011 survey of Wikipedia editors to answser questions about the people who write and maintain English-language Wikipedia. This is a very messy dataset, so you will learn some new techniques of data cleaning. You will also learn to make interactive graphs.

Questions:

1. What percentage of contributors to English-language Wikipedia are men? We will answer this question with a pie chart that explicitly gives the answer to this question with a label. You will also answer it with two different versions of an interactive pie chart. Note that we only use pie charts for variables with (exactly) two categories (in this case, male and non-male).

2. How many contributors to English-language Wikipedia, living inside and outside the United States, at each age, identify as male, female, or trans? We will answer this question with two sets of stacked vertical bar graphs (age on the x-axis, number of contributors on the y-axis). Both will facet by residence (US or non-US) and use color for gender. One will be static (made with ggplot) and the other will be interactive (made with plotly).

3. How many contributors to English-language Wikipedia live in each country, and how many edits have been made from each country? We will answer this question with a bubble chart.

4. What other languages are spoken by contributors to English-language Wikipedia? We will answer this question with an interactive horizontal bar graph showing the percentage of contributors who speak each language (other than English).

0. Getting started

Load the tidyverse package and read in the data as an object called wiki. Use the glimpse() function to take a look at it.

library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.6.1
## Warning: package 'ggplot2' was built under R version 4.6.1
## Warning: package 'tibble' was built under R version 4.6.1
## Warning: package 'tidyr' was built under R version 4.6.1
## Warning: package 'readr' was built under R version 4.6.1
## Warning: package 'purrr' was built under R version 4.6.1
## Warning: package 'dplyr' was built under R version 4.6.1
## Warning: package 'stringr' was built under R version 4.6.1
## Warning: package 'forcats' was built under R version 4.6.1
## Warning: package 'lubridate' was built under R version 4.6.1
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.2.1     ✔ readr     2.2.0
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.3     ✔ tibble    3.3.1
## ✔ lubridate 1.9.5     ✔ tidyr     1.3.2
## ✔ purrr     1.2.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
wiki <- read.csv("wikipedia_dataset.csv")

glimpse(wiki)
## Rows: 5,281
## Columns: 562
## $ id            <int> 5, 6, 7, 9, 976, 12, 13, 43, 67, 17, 20, 23, 24, 26, 27,…
## $ startlanguage <chr> "ru", "en", "en", "en", "Other", "en", "en", "en", "en",…
## $ D1b           <dbl> 600, 7, 18500, 10, 300, 12790, 250, 2926, 5000, 300, 550…
## $ D2_1          <int> 45, 15, 49, 16, 57, 18, 49, 18, 22, 20, 39, 52, 23, 39, …
## $ D3a           <chr> "A5", "A1", "A3", "A1", "A3", "A2", "A5", "A2", "A4", "A…
## $ D3b           <int> 2, 1, 2, 2, 2, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1,…
## $ D4            <chr> "A1", "A3", "A1", "A3", "A2", "A2", "A1", "A3", "A3", "A…
## $ D5a           <chr> " ", "A3", "A1", "A3", "A3", "A3", "A1", "A3", "A3", "A3…
## $ D5b           <int> NA, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, NA, 2, …
## $ D7b           <chr> "84", "96", "96", "96", "4", "16", "35", "96", "Other", …
## $ D8            <chr> "A1", "A3", "A1", "A1", "A1", "A2", "A3", "A1", "A1", "A…
## $ D8a           <int> 2, NA, 2, 2, 2, NA, NA, 2, 1, 1, 1, 1, NA, 1, NA, 2, NA,…
## $ D9_1          <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_2          <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_3          <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_4          <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_5          <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_6          <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_7          <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_8          <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_9          <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_10         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_11         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_12         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_13         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_14         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_15         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_16         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_17         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_18         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_19         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_20         <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0,…
## $ D9_21         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_22         <int> 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,…
## $ D9_23         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_24         <int> 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,…
## $ D9_25         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_26         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_27         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_28         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_29         <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D9_30         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_31         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_32         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_33         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_34         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_35         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_36         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_37         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_38         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_39         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_40         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_41         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_42         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_43         <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1,…
## $ D9_44         <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D9_45         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_46         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_47         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_48         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_49         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_50         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_51         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_52         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_53         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_54         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_55         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_56         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_57         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_58         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_59         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_60         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_61         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_62         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_63         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_64         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_65         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_66         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_67         <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D9_68         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_69         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_70         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_71         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_72         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_73         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_74         <int> 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D9_75         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_76         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_77         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_78         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_79         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_80         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_81         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_82         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_83         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_84         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_85         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_86         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_87         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_88         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_89         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_90         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_91         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_92         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_93         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_94         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_95         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_96         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ D9_97         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_98         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D9_99         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ D10           <chr> "A1", "A1", "A1", "A1", "A2", "A1", "A1", "A1", "A1", "A…
## $ D11           <chr> "A1", "A1", "A3", "A1", "A1", "A3", "A6", "A4", "A3", "A…
## $ D12           <chr> "A4", "A4", "A3", "A2", "A4", "A3", "A3", "A3", "A3", "A…
## $ Q1a_1         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_2         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_3         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_4         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_5         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_6         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_7         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_8         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_9         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_10        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_11        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_12        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_13        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_14        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_15        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_16        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_17        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_18        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_19        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_20        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0,…
## $ Q1a_21        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_22        <int> 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1,…
## $ Q1a_23        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_24        <int> 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,…
## $ Q1a_25        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_26        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_27        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_28        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_29        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,…
## $ Q1a_30        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_31        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_32        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_33        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_34        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_35        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_36        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_37        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_38        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_39        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_40        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_41        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_42        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_43        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,…
## $ Q1a_44        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q1a_45        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_46        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_47        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_48        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_49        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_50        <chr> "0", "1", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_51        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_52        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_53        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_54        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_55        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_56        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_57        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_58        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_59        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_60        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_61        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_62        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_63        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_64        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_65        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_66        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_67        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q1a_68        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_69        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_70        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_71        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_72        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_73        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_74        <int> 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,…
## $ Q1a_75        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_76        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_77        <int> 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q1a_78        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_79        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_80        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_81        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_82        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_83        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q1a_84        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_85        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_86        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_87        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_88        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_89        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_90        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_91        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_92        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_93        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_94        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_95        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_96        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1a_97        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_98        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q1a_99        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q1b           <chr> "74", "22", "22", "22", "Other", "-oth-", "22", "22", "2…
## $ Q2a_1         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_2         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_3         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_4         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_5         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_6         <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_7         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_8         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_9         <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_10        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_11        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_12        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_13        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_14        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,…
## $ Q2a_15        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_16        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_17        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_18        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_19        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q2a_20        <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0,…
## $ Q2a_21        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_22        <int> 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1,…
## $ Q2a_23        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_24        <int> 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0,…
## $ Q2a_25        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_26        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_27        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "1", "0", "0…
## $ Q2a_28        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_29        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,…
## $ Q2a_30        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_31        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_32        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_33        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_34        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q2a_35        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_36        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_37        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_38        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_39        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_40        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_41        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_42        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_43        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1,…
## $ Q2a_44        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q2a_45        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_46        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_47        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_48        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_49        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_50        <int> 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,…
## $ Q2a_51        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_52        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_53        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_54        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_55        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_56        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_57        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_58        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_59        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_60        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_61        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_62        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_63        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q2a_64        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_65        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q2a_66        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_67        <int> 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q2a_68        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_69        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_70        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,…
## $ Q2a_71        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_72        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_73        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_74        <chr> "1", "0", "1", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_75        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_76        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_77        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,…
## $ Q2a_78        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_79        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_80        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_81        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_82        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_83        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q2a_84        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_85        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_86        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_87        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_88        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_89        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_90        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q2a_91        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_92        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_93        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_94        <chr> "Other", "Other", "Other", "Other", "Other", "Other", "O…
## $ Q2a_95        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_96        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_97        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_98        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2a_99        <chr> "0", "0", "0", "0", "Other", "0", "0", "0", "0", "0", "0…
## $ Q2b           <chr> "74", "22", "22", "22", "24", "22", "22", "22", "22", "2…
## $ Q3_SQ001      <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q3_SQ002      <int> 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1,…
## $ Q3_SQ003      <int> 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0,…
## $ Q3_SQ004      <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,…
## $ Q3_SQ005      <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q3_SQ006      <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q3_SQ007      <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q4a_SQ001     <chr> "A1", "A3", "A5", "A2", "A1", "A5", "A3", "A3", "A3", "A…
## $ Q4a_SQ002     <chr> "A1", "A4", "A5", "A3", "A3", "A4", "A5", "A5", "A5", "A…
## $ Q4a_SQ003     <chr> "A3", "A4", "A5", "A5", "A3", "A5", "A5", "A4", "A5", "A…
## $ Q4a_SQ004     <chr> "A1", "A5", "A1", "A1", "A1", "A1", "A1", "A3", "A3", "A…
## $ Q4a_SQ005     <chr> "A3", "A1", "A2", "A5", "A4", "A5", "A1", "A2", "A5", "A…
## $ Q4a_SQ006     <chr> "A1", "A1", "A3", "A5", "A2", "A1", "A1", "A2", "A2", "A…
## $ Q4a_SQ007     <chr> "A1", "A1", "A1", "A4", "A1", "A2", "A1", "A2", "A2", "A…
## $ Q4a_SQ008     <chr> "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A2", "A…
## $ Q4a_SQ009     <chr> "A1", "A1", "A1", "A5", "A1", "A1", "A1", "A1", "A1", "A…
## $ Q4a_SQ010     <chr> "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A2", "A…
## $ Q4a_SQ011     <chr> "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A4", "A…
## $ Q4a_SQ012     <chr> "A1", "A1", "A5", "A5", "A3", "A5", "A3", "A4", "A3", "A…
## $ Q4a_SQ013     <chr> "A1", "A1", "A2", "A5", "A1", "A3", "A1", "A2", "A2", "A…
## $ Q4b_SQ001     <chr> "A1", "A1", "A4", "A1", "A1", "A5", "A1", "A3", "A1", "A…
## $ Q4b_SQ002     <chr> "A1", "A2", "A1", "A4", "A1", "A2", "A1", "A3", "A3", "A…
## $ Q4b_SQ003     <chr> "A2", "A1", "A5", "A2", "A3", "A5", "A1", "A3", "A5", "A…
## $ Q4b_SQ004     <chr> "A1", "A1", "A2", "A3", "A2", "A2", "A1", "A3", "A1", "A…
## $ Q5a_SQ001     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,…
## $ Q5a_SQ002     <int> 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0,…
## $ Q5a_SQ003     <int> 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,…
## $ Q5a_SQ004     <int> 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0,…
## $ Q5a_SQ005     <int> 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,…
## $ Q5a_SQ006     <int> 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,…
## $ Q5a_SQ007     <int> 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0,…
## $ Q5a_SQ008     <int> 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,…
## $ Q5a_SQ009     <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q5a_SQ010     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q5b_SQ001     <int> 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q5b_SQ002     <int> 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0,…
## $ Q5b_SQ003     <int> 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,…
## $ Q5b_SQ004     <int> 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1,…
## $ Q5b_SQ005     <int> 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0,…
## $ Q5b_SQ006     <int> 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0,…
## $ Q5b_SQ007     <int> 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0,…
## $ Q5b_SQ008     <int> 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0,…
## $ Q5b_SQ009     <int> 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q5b_SQ010     <int> 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,…
## $ Q5b_SQ011     <int> 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0,…
## $ Q6_SQ001      <chr> "A2", "A2", "A3", "A2", "A2", "A2", "A2", "A3", "A3", "A…
## $ Q6_SQ002      <chr> "A2", "A2", "A4", "A2", "A3", "A2", "A2", "A2", "A4", "A…
## $ Q6_SQ003      <chr> "A2", "A2", "A4", "A3", "A2", "A2", "A1", "A3", "A2", "A…
## $ Q6_SQ004      <chr> "A2", "A2", "A2", "A1", "A2", "A2", "A2", "A2", "A2", "A…
## $ Q6_SQ005      <chr> "A2", "A1", "A3", "A1", "A1", "A2", "A1", "A3", "A2", "A…
## $ Q6_SQ006      <chr> "A2", "A3", "A2", "A2", "A4", "A2", "A3", "A4", "A3", "A…
## $ Q6_SQ007      <chr> "A2", "A3", "A3", "A2", "A1", "A2", "A3", "A3", "A3", "A…
## $ Q6_SQ008      <chr> "A2", "A1", "A3", "A2", "A1", "A2", "A1", "A3", "A2", "A…
## $ Q7c           <chr> "A1", "A1", "-oth-", "A2", "A11", "A1", "A1", "A10", "A8…
## $ Q8a_SQ001     <int> 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1,…
## $ Q8a_SQ002     <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1,…
## $ Q8a_SQ003     <int> 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,…
## $ Q8a_SQ004     <int> 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1,…
## $ Q8a_SQ005     <int> 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1,…
## $ Q8a_SQ006     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q8b           <int> 1, 2, NA, NA, 2, 2, 1, 2, 1, 1, 1, NA, NA, 2, 2, 2, 2, 1…
## $ Q8c_SQ001     <int> 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1,…
## $ Q8c_SQ002     <int> 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1,…
## $ Q8c_SQ003     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q8c_SQ004     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q8c_SQ005     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q8d_SQ001     <int> 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0,…
## $ Q8d_SQ002     <int> 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1,…
## $ Q8d_SQ003     <int> 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,…
## $ Q8d_SQ004     <int> 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0,…
## $ Q8d_SQ005     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q9_SQ001      <chr> " ", "A0", "A0", "A0", "A0", "A6", "A6", "A6", "A0", "A5…
## $ Q9_SQ002      <chr> " ", "A6", "A5", "A4", "A6", "A6", "A5", "A5", "A6", "A6…
## $ Q9_SQ003      <chr> " ", "A6", "A0", "A0", "A5", "A3", "A0", "A6", "A4", "A4…
## $ Q9_SQ004      <chr> " ", "A6", "A0", "A2", "A0", "A3", "A0", "A6", "A0", "A0…
## $ Q9_SQ005      <chr> " ", "A0", "A6", "A0", "A0", "A6", "A6", "A6", "A0", "A6…
## $ Q9_SQ006      <chr> " ", "A0", "A0", "A0", "A0", "A4", "A0", "A6", "A0", "A0…
## $ Q9_SQ007      <chr> " ", "A6", "A0", "A0", "A0", "A6", "A6", "A6", "A4", "A0…
## $ Q9_SQ008      <chr> " ", "A5", "A6", "A6", "A6", "A5", "A6", "A5", "A6", "A6…
## $ Q9_SQ009      <chr> " ", "A0", "A0", "A0", "A0", "A6", "A0", "A0", "A0", "A0…
## $ Q9_SQ010      <chr> " ", "A0", "A6", "A3", "A6", "A0", "A6", "A6", "A6", "A6…
## $ Q9_SQ011      <chr> " ", "A0", "A0", "A0", "A0", "A4", "A0", "A6", "A0", "A0…
## $ Q9_SQ012      <chr> " ", "A5", "A6", "A6", "A6", "A3", "A6", "A4", "A3", "A6…
## $ Q9_SQ013      <chr> " ", "A4", "A3", "A4", "A0", "A3", "A6", "A4", "A6", "A0…
## $ Q9_SQ014      <chr> " ", "A5", "A0", "A0", "A0", "A0", "A0", "A0", "A0", "A0…
## $ Q10_SQ001     <chr> " ", "A2", "A1", "A1", " ", "A1", "A2", "A3", "A3", "A2"…
## $ Q10_SQ002     <chr> " ", "A2", "A5", "A1", " ", "A1", "A5", "A4", "A4", "A5"…
## $ Q10_SQ003     <chr> " ", "A5", "A5", " ", " ", "A1", "A5", "A5", "A5", "A5",…
## $ Q10_SQ004     <chr> " ", "A5", "A5", " ", " ", "A1", "A4", "A4", "A5", "A1",…
## $ Q10_SQ005     <chr> " ", "A2", "A1", "A1", " ", "A1", "A4", "A2", "A2", "A5"…
## $ Q11_SQ001     <chr> " ", "A2", " ", " ", "A2", "A2", "A2", "A2", "A1", "A2",…
## $ Q11_SQ002     <chr> " ", "A2", " ", " ", "A2", "A1", "A2", "A2", "A3", "A2",…
## $ Q11_SQ003     <chr> " ", "A2", " ", " ", "A2", "A1", "A2", "A2", "A3", "A2",…
## $ Q11_SQ004     <chr> " ", "A2", " ", " ", "A2", "A2", "A2", "A2", "A1", "A2",…
## $ Q11_SQ005     <chr> " ", "A2", " ", " ", "A2", "A2", "A1", "A2", "A3", "A2",…
## $ Q11_SQ006     <chr> " ", "A2", " ", " ", "A2", "A2", "A1", "A2", "A3", "A2",…
## $ Q11_SQ007     <chr> " ", "A2", " ", " ", "A2", "A1", "A1", "A2", "A3", "A2",…
## $ Q11_SQ008     <chr> " ", "A2", " ", " ", "A2", "A1", "A1", "A2", "A3", "A1",…
## $ Q11_SQ009     <chr> " ", "A2", " ", " ", "A2", "A1", "A3", "A1", "A1", "A1",…
## $ Q11_SQ010     <chr> " ", "A2", " ", " ", "A2", "A1", "A2", "A2", "A3", "A1",…
## $ Q11_SQ011     <chr> " ", "A2", " ", " ", "A2", "A1", "A1", "A2", "A3", "A1",…
## $ Q11_SQ012     <chr> " ", "A2", " ", " ", "A2", "A2", "A1", "A2", "A3", "A2",…
## $ Q11_SQ013     <chr> " ", "A2", " ", " ", "A2", "A2", "A1", "A2", "A3", "A2",…
## $ Q11_SQ014     <chr> " ", "A2", " ", " ", "A2", "A2", "A3", "A2", "A3", "A2",…
## $ Q11_SQ015     <chr> " ", "A2", " ", " ", "A2", "A2", "A3", "A3", "A1", "A2",…
## $ Q12_SQ001     <chr> " ", "A2", " ", " ", "A2", "A2", "A1", "A2", "A2", "A1",…
## $ Q12_SQ002     <chr> " ", "A2", " ", " ", "A2", "A2", "A2", "A2", "A2", "A2",…
## $ Q12_SQ003     <chr> " ", "A2", " ", " ", "A2", "A2", "A2", "A2", "A2", "A2",…
## $ Q12_SQ004     <chr> " ", "A1", " ", " ", "A2", "A2", "A1", "A2", "A1", "A1",…
## $ Q12_SQ005     <chr> " ", "A2", " ", " ", "A2", "A2", "A2", "A2", "A2", "A2",…
## $ Q12_SQ006     <chr> " ", "A2", " ", " ", "A2", "A2", "A1", "A2", "A2", "A1",…
## $ Q12_SQ007     <chr> " ", "A2", " ", " ", "A2", "A2", "A1", "A2", "A1", "A1",…
## $ Q12_SQ008     <chr> " ", "A1", " ", " ", "A2", "A2", "A1", "A2", "A1", "A1",…
## $ Q12_SQ009     <chr> " ", "A1", " ", " ", "A2", "A2", "A2", "A2", "A1", "A1",…
## $ Q12_SQ010     <chr> " ", "A2", " ", " ", "A2", "A2", "A2", "A2", "A1", "A2",…
## $ Q13a_SQ001    <chr> "A5", "A1", "A5", "A5", "A5", "A5", "A5", "A3", "A3", "A…
## $ Q13a_SQ002    <chr> "A5", "A4", "A5", "A2", "A5", "A5", "A5", "A4", "A2", "A…
## $ Q13a_SQ003    <chr> "A5", "A3", "A5", "A1", "A5", "A5", "A4", "A3", "A2", "A…
## $ Q13a_SQ004    <chr> "A5", "A4", "A5", "A2", "A5", "A5", "A4", "A3", "A4", "A…
## $ Q13a_SQ005    <chr> "A5", "A1", "A5", "A2", "A5", "A5", "A4", "A2", "A1", "A…
## $ Q13a_SQ006    <chr> "A5", "A2", "A5", "A1", "A5", "A5", "A5", "A3", "A3", "A…
## $ Q14a          <chr> " ", "A1", "A1", " ", " ", "A1", "A1", "A1", "A1", "A2",…
## $ Q14b          <chr> " ", "A1", "A1", " ", " ", "A1", "A1", "A1", "A1", "A2",…
## $ Q15           <dbl> 0, 0, 15, 10, 6, 100, 2, 7, 10, 0, 250, 0, 10, 130, 5, 1…
## $ Q16_SQ001     <int> 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0,…
## $ Q16_SQ002     <int> 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1,…
## $ Q16_SQ003     <int> 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0,…
## $ Q16_SQ004     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q16_SQ005     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q16_SQ006     <int> 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0,…
## $ Q16_SQ007     <int> 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,…
## $ Q16_SQ008     <int> 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0,…
## $ Q16_SQ009     <int> 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q16_SQ010     <int> 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q16_SQ011     <int> 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,…
## $ Q17_SQ001     <int> 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0,…
## $ Q17_SQ002     <int> 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,…
## $ Q17_SQ003     <int> 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1,…
## $ Q17_SQ004     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,…
## $ Q17_SQ005     <int> 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0,…
## $ Q17_SQ006     <int> 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0,…
## $ Q17_SQ007     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,…
## $ Q17_SQ008     <int> 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0,…
## $ Q18_SQ001     <int> 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,…
## $ Q18_SQ002     <int> 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1,…
## $ Q18_SQ003     <int> 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1,…
## $ Q18_SQ004     <int> 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0,…
## $ Q18_SQ005     <int> 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1,…
## $ Q18_SQ006     <int> 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,…
## $ Q18_SQ007     <int> 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0,…
## $ Q18_SQ008     <int> 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0,…
## $ Q18_SQ009     <int> 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1,…
## $ Q18_SQ010     <int> 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0,…
## $ Q18_SQ011     <int> 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1,…
## $ Q18_SQ012     <int> 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1,…
## $ Q18_SQ013     <int> 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0,…
## $ Q18_SQ014     <int> 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0,…
## $ Q18_SQ015     <int> 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1,…
## $ Q18_SQ016     <int> 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0,…
## $ Q18_SQ017     <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1,…
## $ Q19_SQ001     <chr> " ", " ", "A3", " ", " ", "A3", "A2", "A3", "A2", "A3", …
## $ Q19_SQ002     <chr> "A2", " ", " ", " ", " ", " ", " ", "A3", " ", " ", "A2"…
## $ Q19_SQ003     <chr> " ", " ", " ", " ", " ", "A3", " ", "A3", "A3", " ", "A3…
## $ Q19_SQ004     <chr> " ", " ", " ", " ", " ", " ", " ", " ", "A3", " ", "A3",…
## $ Q19_SQ005     <chr> " ", "A3", "A3", " ", " ", "A3", " ", "A2", "A2", " ", "…
## $ Q19_SQ006     <chr> " ", "A3", "A3", " ", " ", "A3", "A3", "A2", "A2", "A2",…
## $ Q19_SQ007     <chr> " ", " ", "A3", " ", " ", "A3", " ", "A2", " ", " ", " "…
## $ Q19_SQ008     <chr> " ", " ", " ", " ", " ", " ", " ", "A2", "A2", " ", "A2"…
## $ Q19_SQ009     <chr> " ", " ", "A3", " ", " ", "A3", " ", "A3", " ", " ", "A3…
## $ Q19_SQ010     <chr> " ", " ", " ", " ", " ", "A3", " ", "A3", "A2", " ", "A3…
## $ Q19_SQ011     <chr> " ", " ", " ", " ", " ", " ", "A1", "A2", " ", " ", " ",…
## $ Q19_SQ012     <chr> " ", " ", "A2", "A2", "A2", "A2", "A2", "A2", " ", " ", …
## $ Q19_SQ013     <chr> " ", " ", "A1", " ", " ", " ", "A1", " ", " ", "A1", " "…
## $ Q19_SQ014     <chr> " ", " ", "A2", " ", "A1", " ", "A1", "A3", " ", "A1", "…
## $ Q19_SQ015     <chr> " ", " ", "A1", " ", "A1", "A1", "A1", "A1", " ", " ", "…
## $ Q19_SQ016     <chr> " ", " ", "A2", " ", "A1", "A1", " ", "A1", "A1", "A1", …
## $ Q19_SQ017     <chr> " ", " ", " ", " ", " ", " ", " ", "A3", " ", " ", " ", …
## $ Q20           <chr> " ", "A1", "A2", " ", "A2", "A1", "A1", "A2", "A1", " ",…
## $ Q21_1         <chr> "A1", "A1", "A2", " ", " ", "A1", "A5", "A2", "A2", "A1"…
## $ Q21_2         <chr> "A5", "A2", "A1", " ", " ", "A2", "A4", "A1", "A3", "A3"…
## $ Q21_3         <chr> "A6", "A4", "A4", " ", " ", "A4", "A6", "A6", "A4", "A5"…
## $ Q21_4         <chr> " ", "A5", "A6", " ", " ", "A6", "A1", "A3", "A5", "A4",…
## $ Q21_5         <chr> " ", "A6", "A3", " ", " ", "A5", "A3", "A4", "A6", "A6",…
## $ Q21_6         <chr> " ", "A3", "A5", " ", " ", "A3", "A2", "A5", "A1", "A2",…
## $ Q22_SQ001     <int> 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q22_SQ002     <int> 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,…
## $ Q22_SQ003     <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,…
## $ Q22_SQ004     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ Q22_SQ005     <int> 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1,…
## $ Q22_SQ006     <int> 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,…
## $ Q22_SQ007     <int> 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,…
## $ Q22_SQ008     <int> 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0,…
## $ Q23_SQ001     <int> 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0,…
## $ Q23_SQ002     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0,…
## $ Q23_SQ003     <int> 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,…
## $ Q26_1         <int> 4, 2, 2, 2, 3, 4, 4, 1, 1, 2, 3, 3, 2, 2, 4, 2, 4, 4, 2,…
## $ Q26_2         <int> 4, 4, 2, 4, 2, 2, 4, 2, 3, 2, 2, 2, 2, 4, 4, 2, 4, 2, 2,…
## $ Q26_3         <int> 4, 4, 4, 4, 3, 4, 4, 2, 4, 4, 2, 4, 2, 4, 2, 2, 4, 4, 2,…
## $ Q26_4         <int> 4, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4,…
## $ Q26_5         <int> 4, 2, 4, 4, 3, 4, 4, 4, 3, 2, 4, 4, 4, 4, 4, 2, 4, 4, 4,…
## $ Q27           <int> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2,…
## $ D13_1         <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ D13_2         <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D13_3         <int> 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0,…
## $ D13_4         <int> 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D14           <int> 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ D15a          <int> 2, 2, 2, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2,…
## $ D15b          <int> NA, NA, NA, NA, NA, 1, 1, NA, 4, NA, 2, 3, NA, NA, NA, N…
## $ D15b2         <int> NA, NA, NA, NA, NA, 2, 2, NA, 3, NA, 2, 1, NA, NA, NA, N…
## $ Q15b3         <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ D15c_1        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D15c_2        <int> 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0,…
## $ D15c_3        <int> 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0,…
## $ D15c_4        <int> 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0,…
## $ D15c_5        <int> 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D15c_6        <int> 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,…
## $ D15c_7        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D15c_8        <int> 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0,…
## $ D15c_9        <int> 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0,…
## $ D16           <int> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 2,…
## $ D16a          <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1, 1, 2, NA,…
## $ D17           <int> 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1,…
## $ D17a_1        <int> 0, 0, 0, 0, 0, 0, 0, 0, NA, 0, 0, NA, 0, NA, 0, 0, 0, NA…
## $ D17a_2        <int> 1, 0, 0, 0, 0, 0, 0, 1, NA, 0, 0, NA, 0, NA, 0, 0, 1, NA…
## $ D17a_3        <int> 0, 0, 0, 0, 0, 1, 0, 1, NA, 1, 0, NA, 1, NA, 0, 0, 1, NA…
## $ D17a_4        <int> 0, 0, 0, 0, 0, 0, 0, 0, NA, 0, 0, NA, 0, NA, 0, 0, 0, NA…
## $ D17a_5        <int> 0, 0, 1, 0, 0, 0, 0, 1, NA, 0, 1, NA, 1, NA, 1, 1, 1, NA…
## $ D17a_6        <int> 0, 0, 0, 1, 1, 0, 1, 0, NA, 1, 0, NA, 0, NA, 0, 0, 1, NA…
## $ D18a          <int> NA, NA, NA, 1, 2, NA, 1, NA, NA, 1, NA, NA, NA, NA, NA, …
## $ D19           <int> 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,…
## $ D19a_1        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D19a_2        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D19a_3        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D19a_4        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D19a_5        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ D20a_SQ001    <int> 1, 8, 10, 3, 1, 7, 8, 6, 8, 3, 9, 6, 9, 7, 5, 6, 7, 8, 8…
## $ D20b_SQ001    <int> 10, 9, 7, 10, 1, 9, 7, 9, 10, 8, 9, 9, 9, 6, 5, 7, 7, 10…
## $ D20c_SQ001    <int> 10, 8, 5, 10, 5, 9, 8, 9, 6, 3, 8, 5, 7, 6, 5, 6, 7, 7, …
## $ D20d_SQ001    <int> 10, 6, 3, 10, 5, 9, 5, 4, 7, 2, 8, 7, 7, 7, 5, 6, 7, 9, …
## $ D21_1         <dbl> 20, 25, 70, 0, 10, 20, 15, 10, 60, 20, 40, 99, 10, 20, 8…
## $ D21_2         <dbl> 20, 5, 20, 5, 0, 10, 10, 0, 5, 10, 5, 0, 10, 0, 0, 10, 1…
## $ D21_3         <dbl> 20, 10, 10, 45, 0, 20, 30, 0, 10, 30, 15, 1, 0, 20, 10, …
## $ D21_4         <dbl> 20, 25, 0, 0, 50, 10, 10, 10, 15, 30, 5, 0, 0, 15, 0, 0,…
## $ D21_5         <dbl> 10, 15, 0, 0, 10, 20, 5, 10, 0, 10, 10, 0, 10, 20, 0, 10…
## $ D21_6         <dbl> 10, 10, 0, 0, 30, 5, 0, 10, 10, 0, 10, 0, 50, 0, 0, 10, …
## $ D21_7         <dbl> 0, 5, 0, 0, 0, 10, 30, 50, 0, 0, 10, 0, 10, 10, 0, 20, 5…
## $ D21_8         <dbl> 0, 5, 0, 50, 0, 5, 0, 10, 0, 0, 5, 0, 10, 15, 10, 10, 10…
## $ D22a          <int> 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1,…

There are two things to notice here: first, the variables and values do not have intuitive names, so we will need to rely heavily on the codebook to understand what the data mean; second, most values are zero, missing, or “Other”.

For this notebook, we only want to include people who contributed to the English-language version of Wikipedia, so we will create a new dataframe that only includes those people. We will call it en. According to the codebook, contributors to English-language Wikipedia (who may also contribute to other versions) have a value of 1 for the variable Q1a_22.

en <- wiki |>
  filter(Q1a_22 == 1)

1. What percentage of contributors to English-language Wikipedia are men?

According to the codebook, the variable D10 encodes gender as follows: A1 = Male, A2 = Female, A3 = Transsexual, A4 = Transgender. We are going to create a new dataset with only this one variable. We will start by recoding it as a factor, with the values “Male”, “Female”, “Trans” in that order. We will call the new dataset gen and the new variable will be called gender. Remember to start with the en dataframe, since that one only includes contributors to English-language Wikipedia.

#1. create the new variable
gen <- en |>
  mutate(gender = factor(D10, labels = c("Male", "Female", "Trans", "Trans")))

#2. Test the new variable
table(gen$gender, gen$D10)
##         
##            A1   A2   A3   A4
##   Male   3446    0    0    0
##   Female    0  325    0    0
##   Trans     0    0   10   11
#3. Keep only the new variable
gen <- gen |>
  select(gender)

#4. Test to make sure we have the right variable
names(gen)
## [1] "gender"

For the first two pie charts, we want to aggregate respondents into two categories: male and non-male. We will create a new data frame called men that does that. Since pie charts graph percentages, we will also calculate the percentage of respondents who are male and non-male.

men <- gen |>
  count(male= gender== "Male") |>
  mutate(pct= n / sum(n))

men
##    male    n        pct
## 1 FALSE  346 0.09124473
## 2  TRUE 3446 0.90875527

Now we can make pie charts. We will start with a non-interactive pie chart.

men |>
  ggplot(aes(x="", y = pct, fill= male))+
  geom_col()+
  coord_polar(theta="y")+
theme_void()+
  scale_fill_viridis_d()+
  labs(fil="Male")
## Ignoring unknown labels:
## • fil : "Male"

This is, technically, what we are going for, but it’s not awesome. Humans are notoriously bad at judging areas, so let’s give it a label to make it easier for our audience. We are going to create a label for the yellow part only that says “Over 90% of contributors to English-language Wikipedia identify as male”. We do this with a new variable that takes the value of our label text for the TRUE row and takes a null value for the FALSE row.

men |> 
  mutate(label=ifelse(male, "Over 90$ of contributors to English \nlanguage wikipedia idenitfy as male ", NA)) |>
#dont need to specify is male is true because its a logical variable 
   ggplot(aes(x="", y = pct, fill= male, label=label))+
  geom_col()+
  coord_polar(theta="y")+
theme_void()+
  scale_fill_viridis_d()+
  labs(fil="Male")+
  geom_col(show.legend= F)+
  geom_label(show.legend= F, position= position_stack(vjust= 0.35))
## Ignoring unknown labels:
## • fil : "Male"
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_label()`).

We will use the plotly package to make an interactive version of this graph. Install the plotly package if you don’t already have it installed. Notice that the plotting code is very different for the plot_ly() function than for the ggplot() function. You will not be tested on it.

#Run once and then comment out:
#install.packages("plotly")

men |> 
  plotly::plot_ly(labels= ~male, values= ~n, type="pie")|>
   plotly::layout(title="Over 90$ of contributors to English \nlanguage wikipedia idenitfy as male")

This is almost what we want, but we want the values in the legend and the mouseovers to say “Male” and “Non-Male” instead of “true” and “false”. We can do that by turning the male variable into a factor.

men |> 
  mutate(male= factor(male, labels= c("Non-male", "Male")))|>
  plotly::plot_ly(labels= ~male, values= ~n, type="pie")|>
   plotly::layout(title="Over 90$ of contributors to English \nlanguage wikipedia idenitfy as male")

It would be nice to have the “Male” and “Non-Male” labels inside the pie. We can do that with plotly options; we can also change the colors and control what text pops up on mouseover. I want my mouseover text to give the sample size and the number of people who identified with each category.

First we will see how many people identified with each category.

gender <- gen|>
  count(gender)
head(gender)
##   gender    n
## 1   Male 3446
## 2 Female  325
## 3  Trans   21

Now we will factor the male variable, add a new variable for the mouseover text, and graph.

men|>
 mutate(male= factor(male, labels= c("Non-male", "Male")), 
                  text= ifelse(male == "Male", 
                               str_c(" Of ", sum(gender$n) , " respondents ", gender[1,"n"] , " indentified as male"), 
                               str_c(" Of ",sum(gender$n) , " respondents ", gender[2, "n"] , " indentified as female ", gender[3, "n"] , " as trans"))) |>
  
  plotly::plot_ly(labels= ~male, values= ~n, type="pie", textposition= "inside", 
                  textinfo= "label+percent", 
                  hoverinfo="text",
                  text= ~text, 
                  marker= list(colors= c("#b97f18","#902625" )), 
                  showlegend= F)|>
   plotly::layout(title="Over 90$ of contributors to English \nlanguage wikipedia idenitfy as male")

2. How many contributors to English-language Wikipedia, living inside and outside the United States, identify as male, female, or trans?

We will need to create a new data frame to make these graphs. We will call it gen_res (for “gender” and “residence”). It will initially have three variables, one for gender (coded as before), one indicating age (variable D2_1 in the original dataset), and one indicating whether or not a person lives in the United States. According to the codebook, people who live in the United States have a value of 96 for the variable D7b. We will call this variable residence and code it as a factor with the values “Does not live in US” and “Lives in US”. Once we have these new variables, we will aggregate into gender/residence/age categories with the count() function. Also by age

# 1. Create new variables
gen_res <- en |>
  mutate(gender = factor(D10, labels= c("Male", "Female", "Trans", "Trans")),
         residence = factor(D7b ==96, labels = c("Does not live in the U.S", "Does live in the U.S"))) |>
  rename(age = D2_1)


# 2. Test new variables

table(gen_res$gender, gen_res$D10)
##         
##            A1   A2   A3   A4
##   Male   3446    0    0    0
##   Female    0  325    0    0
##   Trans     0    0   10   11
table(gen_res$residence, gen_res$D7b)
##                           
##                             10 101  14  16  17  18  19  23  24  25  31  32  34
##   Does not live in the U.S  24  28  56 135  31  25  62  36 414  23  66  43 125
##   Does live in the U.S       0   0   0   0   0   0   0   0   0   0   0   0   0
##                           
##                             35   4  41  44  45  48  49   5   6  69  70  71  73
##   Does not live in the U.S 297  32  28  41 111 113  91  42  96  20  49  26  25
##   Does live in the U.S       0   0   0   0   0   0   0   0   0   0   0   0   0
##                           
##                             78  79  83  84  86  94  95  96 Other
##   Does not live in the U.S  86  21  21 163  32  15  41   0   398
##   Does live in the U.S       0   0   0   0   0   0   0 976     0
# 3. Aggregate to new categories
gen_res <-  gen_res |>
  count(gender, residence, age)

head(gen_res)
##   gender                residence age  n
## 1   Male Does not live in the U.S  12 12
## 2   Male Does not live in the U.S  13 29
## 3   Male Does not live in the U.S  14 47
## 4   Male Does not live in the U.S  15 48
## 5   Male Does not live in the U.S  16 93
## 6   Male Does not live in the U.S  17 91

Now we can make the static graph. For colors, we will use a palette from the wesanderson package, so go ahead and install it if you need to.

#Run this line once and then comment out:
#install.packages("wesanderson")

gen_res |>
  ggplot(aes(x=age, y=n, fill= gender))+
  facet_wrap(~residence)+
  geom_col(width=1)+
  theme_bw()+
  scale_fill_manual(values= wesanderson::wes_palette("Darjeeling1", n=3))+
  labs(x= "Age of contributor", y= "Amount of contributors", fill= "Gender", 
       title= "The majority of contributors to english language wikipedia \nindentify as male and do not live in the U.S",
       subtitle = "Data from April 2011 survey of wikipedia editors")

Now let’s make it interactive! We want the mouseover text to be the same for all parts of a given color in a given facet and to indicate the percentage of all contributors who comprise that color in that facet (for example, “68.6% of contributors to English-language Wikipedia identify as male and do not live in the United States”). We will need to calculate this first and then we can join it to the gen_res data frame. For this set of interactive graphs, we will make the graph in ggplot first and then add mouseover text with plotly. To make this work, we will save the ggplot version of the graph as an object called g (for “graph”).

g <- gen_res |>
  group_by(gender, residence)|>
  summarize(n = sum(n))|>
  ungroup()|>
  mutate(pct = n / sum(n),
         all = str_c(round(pct*100, 1), "% of contributors to english langauge Wikipedia identify as ",
                     tolower(gender)), 
         text= ifelse(residence == "Lives in the U.S",
                      str_c(all, " and live in the United States"),
                      str_c(all, " and do not live in the United States")))|>
  select(gender, residence, text)|>
  right_join(gen_res)|>
  
  ggplot(aes(x=age, y=n, fill= gender, text=text))+
  facet_grid(residence~.)+
  geom_col(width=1)+
  theme_bw()+
  scale_fill_manual(values= wesanderson::wes_palette("Darjeeling1", n=3))+
  labs(x= "Age of contributor", y= "Amount of contributors", fill= "Gender", 
       title= "The majority of contributors to english language wikipedia \nindentify as male and do not live in the U.S",
       subtitle = "Data from April 2011 survey of wikipedia editors")
## `summarise()` has regrouped the output.
## Joining with `by = join_by(gender, residence)`
## ℹ Summaries were computed grouped by gender and residence.
## ℹ Output is grouped by gender.
## ℹ Use `summarise(.groups = "drop_last")` to silence this message.
## ℹ Use `summarise(.by = c(gender, residence))` for per-operation grouping
##   (`?dplyr::dplyr_by`) instead.
plotly::ggplotly(g, tooltip = "text")

3. How many contributors to English-language Wikipedia live in each country, how many edits have been made from each country, and what is the median age of contributors from each country?

The first thing we are going to do is create a data frame that indicates, for each country, how many English-language Wikipedia contributors live there, how many edits have been made by contributors living there, and the median age of editors living there. As we saw before, country of residence is variable D7b. Number of edits made by a given contributor is variable D1b (recall that each row represents one contributor). We will call this new data frame ed_res for “editors’ residence”.

ed_res <- en |>
  rename(age= D2_1, country_code= D7b)|>
  mutate(contributors =1 )|>
  group_by(country_code)|>
  summarize(contributors = sum(contributors),
            edits = sum(D1b), 
            med_age= median(age)) 

Now we need to add the names of the countries. Since there are a lot of countries (35), we don’t want to type each one. We will save some labor by making a crosswalk. We will copy the values of D7b from the codebook into a new spreadsheet and save it as a csv file with the column headings “country_code” and “country”. Then we can read it into r and join it to our ed_res data frame.

library(readr)
crosswalk <- read_csv("country_codes.csv", locale = locale(encoding = "UTF-8"))|>
  mutate(country_code = as.character(country_code))
## Rows: 100 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): country
## dbl (1): country_code
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(crosswalk)
## # A tibble: 6 × 2
##   country_code country                           
##   <chr>        <chr>                             
## 1 1            دولة الإمارات العربية المتحدة (ae)
## 2 2            Albania (al)                      
## 3 3            Հայաստան (am)                     
## 4 4            Argentina (ar)                    
## 5 5            Österreich (at)                   
## 6 6            Australia (au)
#After joining, code any countries with missing names as "Unknown" and code countries with code "Other" as "Other"
ed_res <- left_join(ed_res, crosswalk)|>
  mutate(country= case_when(!is.na(country) ~ country, 
                            country_code== "Other" ~ "Other", 
                            TRUE ~ "Unknown"))
## Joining with `by = join_by(country_code)`
ed_res
## # A tibble: 35 × 5
##    country_code contributors   edits med_age country                        
##    <chr>               <dbl>   <dbl>   <dbl> <chr>                          
##  1 10                     24  440452    26   België/Belgique/Belgien (be)   
##  2 101                    28  375413    28   Unknown                        
##  3 14                     56  528138    24.5 Brasil (br)                    
##  4 16                    135  997096    28   Canada (ca)                    
##  5 17                     31  230683    35   Switzerland/Schweiz/Suisse (ch)
##  6 18                     25  132124    23   Chile (cl)                     
##  7 19                     62  238342    21.5 中华人民共和国/China (cn)      
##  8 23                     36  322743    27.5 Česká republika (cz)           
##  9 24                    414 4494099    32   Deutschland (de)               
## 10 25                     23  429182    36   Danmark (dk)                   
## # ℹ 25 more rows

Finally, we will create the mouseover text for each country. This will include the name of the country, the number of editors, the number of edits, and the median age.

ed_res <- ed_res|>
  mutate(text = str_c(country, "\nContributors ", contributors, "\nEdits ", format(edits, big.mark = ","),
                      "\nMedian Age ", round(med_age, 0)))

ed_res
## # A tibble: 35 × 6
##    country_code contributors   edits med_age country                       text 
##    <chr>               <dbl>   <dbl>   <dbl> <chr>                         <chr>
##  1 10                     24  440452    26   België/Belgique/Belgien (be)  "Bel…
##  2 101                    28  375413    28   Unknown                       "Unk…
##  3 14                     56  528138    24.5 Brasil (br)                   "Bra…
##  4 16                    135  997096    28   Canada (ca)                   "Can…
##  5 17                     31  230683    35   Switzerland/Schweiz/Suisse (… "Swi…
##  6 18                     25  132124    23   Chile (cl)                    "Chi…
##  7 19                     62  238342    21.5 中华人民共和国/China (cn)     "中华人…
##  8 23                     36  322743    27.5 Česká republika (cz)          "Čes…
##  9 24                    414 4494099    32   Deutschland (de)              "Deu…
## 10 25                     23  429182    36   Danmark (dk)                  "Dan…
## # ℹ 25 more rows

Now we can graph. We will put number of contributors on the x-axis and number of edits on the y-axis, and size the bubbles by median age. We will order the data by median age (highest to lowest), so that smaller bubbles will graph on top of larger bubbles, and we will make the points semi-transparent so that we can see bubbles on top of bubbles. Again, we will save the ggplot graph as an object called g so we can add interactivity with plotly.

g <- ed_res|>
  arrange(med_age) |>
  ggplot(aes(x= contributors, y=edits, size= med_age, text=text))+
  geom_point(alpha=0.5)+
  theme_classic()+
  scale_y_continuous(labels = scales::comma)+
  labs(x= "Number of contributors", y = "Number of edits", size= "median age",title = "More contributors to english language wikipedia live in the United States than in any over single country")

plotly::ggplotly(g, tooltip = "text")

4. What other languages are spoken by contributors to English-language Wikipedia?

This is where things get really messy. Since a given person can speak any number of languages, each language is a separate variable (D9_1 through D9_99), coded as 1 if the person speaks the language. But the codes are not numeric: they are characters, with either “0” or “Other” if the person doesn’t speak the language.

The first step is to calculate the percentage of contributors who speak each language.

#Isolate the language variables
lang <- en |>
  select(D9_1:D9_99)
head(lang)
##    D9_1  D9_2  D9_3  D9_4  D9_5  D9_6  D9_7  D9_8  D9_9 D9_10 D9_11 D9_12 D9_13
## 1 Other Other     0 Other Other Other Other Other Other Other Other Other Other
## 2 Other Other     0 Other Other Other Other Other Other Other Other Other Other
## 3 Other Other     0 Other Other Other Other Other Other Other Other Other Other
## 4 Other Other Other Other Other Other Other Other Other Other Other Other Other
## 5 Other Other     0 Other Other Other Other Other Other Other Other Other Other
## 6 Other Other     0 Other Other Other Other Other Other Other Other Other Other
##   D9_14 D9_15 D9_16 D9_17 D9_18 D9_19 D9_20 D9_21 D9_22 D9_23 D9_24 D9_25 D9_26
## 1     0 Other     0 Other Other     0     0     0     1     0     0 Other Other
## 2     0 Other     0 Other Other     0     0     0     1     0     0 Other Other
## 3     0 Other     0 Other Other     0     0     0     1     0     0 Other Other
## 4 Other Other Other Other Other Other     0 Other     1 Other     1 Other Other
## 5     0 Other     0 Other Other     0     0     0     1     0     0 Other Other
## 6     0 Other     0 Other Other     0     0     0     1     0     0 Other Other
##   D9_27 D9_28 D9_29 D9_30 D9_31 D9_32 D9_33 D9_34 D9_35 D9_36 D9_37 D9_38 D9_39
## 1 Other     0     0 Other Other Other Other     0     0     0 Other     0 Other
## 2 Other     0     0 Other Other Other Other     0     0     0 Other     0 Other
## 3 Other     0     0 Other Other Other Other     0     0     0 Other     0 Other
## 4 Other Other     0 Other Other Other Other Other Other Other Other Other Other
## 5 Other     0     0 Other Other Other Other     0     0     0 Other     0 Other
## 6 Other     0     0 Other Other Other Other     0     0     0 Other     0 Other
##   D9_40 D9_41 D9_42 D9_43 D9_44 D9_45 D9_46 D9_47 D9_48 D9_49 D9_50 D9_51 D9_52
## 1 Other Other Other     0     0 Other Other Other Other Other     0 Other Other
## 2 Other Other Other     0     0 Other Other Other Other Other     0 Other Other
## 3 Other Other Other     0     0 Other Other Other Other Other     0 Other Other
## 4 Other Other Other     0     0 Other Other Other Other Other Other Other Other
## 5 Other Other Other     0     0 Other Other Other Other Other     0 Other Other
## 6 Other Other Other     0     0 Other Other Other Other Other     0 Other Other
##   D9_53 D9_54 D9_55 D9_56 D9_57 D9_58 D9_59 D9_60 D9_61 D9_62 D9_63 D9_64 D9_65
## 1 Other Other Other Other     0 Other Other Other Other Other     0 Other     0
## 2 Other Other Other Other     0 Other Other Other Other Other     0 Other     0
## 3 Other Other Other Other     0 Other Other Other Other Other     0 Other     0
## 4 Other Other Other Other Other Other Other Other Other Other Other Other Other
## 5 Other Other Other Other     0 Other Other Other Other Other     0 Other     0
## 6 Other Other Other Other     0 Other Other Other Other Other     0 Other     0
##   D9_66 D9_67 D9_68 D9_69 D9_70 D9_71 D9_72 D9_73 D9_74 D9_75 D9_76 D9_77 D9_78
## 1 Other     0 Other Other     0 Other     0 Other     0 Other Other     0 Other
## 2 Other     0 Other Other     0 Other     0 Other     0 Other Other     0 Other
## 3 Other     0 Other Other     0 Other     0 Other     0 Other Other     0 Other
## 4 Other     0 Other Other Other Other Other Other     0 Other Other Other Other
## 5 Other     0 Other Other     0 Other     0 Other     0 Other Other     0 Other
## 6 Other     0 Other Other     0 Other     0 Other     0 Other Other     0 Other
##   D9_79 D9_80 D9_81 D9_82 D9_83 D9_84 D9_85 D9_86 D9_87 D9_88 D9_89 D9_90 D9_91
## 1 Other Other     0 Other     0 Other     0 Other Other Other     0     0 Other
## 2 Other Other     0 Other     0 Other     0 Other Other Other     0     0 Other
## 3 Other Other     0 Other     0 Other     0 Other Other Other     0     0 Other
## 4 Other Other Other Other Other Other Other Other Other Other Other Other Other
## 5 Other Other     0 Other     0 Other     0 Other Other Other     0     0 Other
## 6 Other Other     0 Other     0 Other     0 Other Other Other     0     0 Other
##   D9_92 D9_93 D9_94 D9_95 D9_96 D9_97 D9_98 D9_99
## 1 Other Other Other Other Other     0     0     0
## 2 Other Other Other Other Other     0     0     0
## 3 Other Other Other Other Other     0     0     0
## 4 Other Other Other Other Other Other Other Other
## 5 Other Other Other Other Other     0     0     0
## 6 Other Other Other Other Other     0     0     0
#Code each as a numeric variable taking values of 1 or 0.
for(i in 1:99){
  lang[,i] <- ifelse(lang[,i]== "1", 1, 0)
}

#Calculate the mean of each variable. This indicates the percent of respondents who speak it.
values <- c()
for(i in 1:99){
    values <- c(values, mean(lang[,i]))
}
#Now create a data frame with columns for language code and percent of respondents who speak it
languages <- data.frame(code= 1:99, pct =values)|>
  filter(pct>0, code !=22)
head(languages)
##   code         pct
## 1    3 0.010021097
## 2   14 0.006856540
## 3   16 0.011339662
## 4   19 0.007120253
## 5   20 0.164820675
## 6   21 0.005274262

Now we need to make a crosswalk that matches each language name (or abbreviation) to its numeric code. Read it in, and then we will manipulate it and join it to languages.

crosswalk <- read_csv("language-codes.csv", locale = locale(encoding = "UTF-8"))
## Rows: 99 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): variable, questions
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(crosswalk)
## # A tibble: 6 × 2
##   variable questions                                                            
##   <chr>    <chr>                                                                
## 1 D9_1     [(aa)]  What is/are your primary language(s)? Please choose all that…
## 2 D9_2     [(an)]  What is/are your primary language(s)? Please choose all that…
## 3 D9_3     [(ar)]  What is/are your primary language(s)? Please choose all that…
## 4 D9_4     [Asturianu (ast)]  What is/are your primary language(s)? Please choo…
## 5 D9_5     [(az)]  What is/are your primary language(s)? Please choose all that…
## 6 D9_6     [(bat-smg)]  What is/are your primary language(s)? Please choose all…

For variable, we want just the final digit, so we will remove “D9_” and convert to numeric. For question we want just the part in brackets, which we can get with regular expressions.

#install.packages("stringr")
library(stringr)

lang_codes <- crosswalk|>
  mutate(code= str_extract(variable, "[0-9]+$")|> as.numeric(), 
         language= str_extract(questions, "^\\[.+\\]")|>
         str_remove_all("[\\[\\]]"))

head(lang_codes)
## # A tibble: 6 × 4
##   variable questions                                               code language
##   <chr>    <chr>                                                  <dbl> <chr>   
## 1 D9_1     [(aa)]  What is/are your primary language(s)? Please …     1 (aa)    
## 2 D9_2     [(an)]  What is/are your primary language(s)? Please …     2 (an)    
## 3 D9_3     [(ar)]  What is/are your primary language(s)? Please …     3 (ar)    
## 4 D9_4     [Asturianu (ast)]  What is/are your primary language(…     4 Asturia…
## 5 D9_5     [(az)]  What is/are your primary language(s)? Please …     5 (az)    
## 6 D9_6     [(bat-smg)]  What is/are your primary language(s)? Pl…     6 (bat-sm…

Now we will join our language names to our languages data frame, add mouseover text, and graph.

g <- languages |>
  left_join(lang_codes)|>
  select(code, pct, language)|>
  mutate(text= str_c(round(pct*100,1),
                     "% of contributors to english language Wikipedia also speak ", language))|>
  ggplot(aes(x= reorder(language, pct), y= pct, text=text))+
  geom_col()+
  theme_classic()+
  coord_flip()+
  scale_y_continuous(labels= scales::percent)+
  labs( x=NULL, y = "Percent of contributors to English language wikipedia", 
       subtitle= "Data from April 2011 survey of Wikipedia editors")
## Joining with `by = join_by(code)`
plotly::ggplotly(g, tooltip = "text")

Knit to .html and submit on Canvas!