I am working with [tag: R] on the [tag: Arab Barometer] wave 5, and I'm trying to visualize the political party labels. However, I'm not able to display them.
If I code table(dataset$Q503)
or, for a single country, table(country1$Q503)
, the numerical codes assigned to the parties appear, as well as if I use the command as.factor()
.
In order to display the labels associated with the numeric codes, I was advised to download the R package [tag: expss] and use the command val_lab()
.
However, when I input val_lab(dataset$Q503)
or val_lab(country1$Q503)
in both cases the answer is NULL
.
Any ideas on how to display labels?
The code:
library(tidyverse)
library(expss)
setwd("C:/Users/my_name/Dropbox/work_space/")
Dataset <- read.csv("CodeR/_Databases/Dataset.csv")
Country1 <- subset(Dataset, country==1)
table(Country1$Q503A)
Result:
0 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010
1237 578 60 118 21 18 13 12 17 1 8
So far so good. When I try to identify the corresponding labels, I have problems.
val_lab(Country1$Q503A)
Result:
NULL