I have a 5 dataframes containing multiple variables (110) in three different languages and I'm pretty new to using R. I'm recoding the factors to numbers that I can merge all of the dataframes in the end. With most of the factors it simply worked, except for the following sentence. I suspect that the dot in "ESG Art. 383 und Art. 384" are confusing but I can't get rid of it
data$B1aC <- as.factor(data$B1aC)
levels(data$B1aC)
summary(data$B1aC)
data$B1aC <- factor(data$B1aC, levels = c("Einsatz auf Wunsch des
Bewohners/der Bewohnerin oder im Einverständnis mit dem/der dazu
urteilsfähigen Bewohner/-in","Einsatz bei dazu nicht urteilsfähiger Bewohner/-in, alle Bedingungen (ESG Art. 383 und Art. 384) sind erfüllt","Kontext ist noch nicht geklärt, nicht alle Bedingungen (ESG Art. 383 und Art. 384) sind erfüllt"),labels = c("1", "2", "3"))
table(data$B1aC)
When I display the transformed data, I lose numbers 2 and 3 (both having a dot in their level). Does anyone know what I can do?
I'm using Rstudio on Apple (x86_64-apple-darwin13.4.0) with R 3.3.3 running.
this is the output for table()
table(data$B1aC)
Einsatz auf Wunsch des Bewohners/der Bewohnerin oder im Einverständnis mit dem/der dazu urteilsfähigen Bewohner/-in
1
Einsatz bei dazu nicht urteilsfähiger Bewohner/-in, alle Bedingungen (ESG Art. 383 und Art. 384) sind erfüllt
1
Kontext ist noch nicht geklärt, nicht alle Bedingungen (ESG Art. 383 und Art. 384) sind erfüllt
1
summary(data$B1aC)
Einsatz auf Wunsch des Bewohners/der Bewohnerin oder im Einverständnis mit dem/der dazu urteilsfähigen Bewohner/-in
1
Einsatz bei dazu nicht urteilsfähiger Bewohner/-in, alle Bedingungen (ESG Art. 383 und Art. 384) sind erfüllt
1
Kontext ist noch nicht geklärt, nicht alle Bedingungen (ESG Art. 383 und Art. 384) sind erfüllt
1
NA's
97
I had to convert the strings to numbers because the data frames are in 3 different languages - merging then would confuse me, because I'm not too familiar with all the languages.
after transforming the data:
data$B1aC <- factor(data$B1aC, levels = c("Einsatz auf Wunsch des Bewohners/der Bewohnerin oder im Einverständnis mit dem/der dazu urteilsfähigen Bewohner/-in",
"Einsatz bei dazu nicht urteilsfähiger Bewohner/-in, alle Bedingungen (ESG Art. 383 und Art. 384) sind erfüllt",
"Kontext ist noch nicht geklärt, nicht alle Bedingungen (ESG Art. 383 und Art. 384) sind erfüllt"),
labels = c("1", "2", "3"))
table(data$B1aC)
1 2 3
1 0 0