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 a Latex file).
#example table:parm1 <- 2parm2 <- 0.3rownames_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_tabtab1[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.
Maurane