I am writing a table in R which contains Greek characters and am not able to export the table in CSV or txt file (I want to call the table later in an Latex file).
#example table:
parm1 <- 2
parm2 <- 0.3
rownames_tab <- c( paste('\u2126', "_a", sep="") , paste('\u025B',"_a", sep="") )
tab1 <- as.data.frame( matrix(ncol=1, nrow=length(rownames_tab ) ) )
row.names(tab1) <- rownames_tab
tab1[paste('\u2126', "_a", sep=""),] <- paste("Some explanation of the variable: ", parm1, sep="")
tab1[paste('\u025B', "_a", sep=""),] <- paste("Some explanation of the second variable: ", paste('\u025B', "_a", sep=""), " = " ,parm2, sep="" )
How to save the table in a csv or txt file which contains the greek characters (encoded as utf-8)?
write.csv(tab1, file="test1.csv", fileEncoding = "UTF-8")
write.table(tab1, file="test1.txt", fileEncoding = "UTF-8")
This does not seem to work: if you open these files they do not read the Greek characters.
Thanks a lot in advance for your help,
Best,
Maurane