Issue
I am trying to perform PCA analysis with R running the following command:
> pca.earn <- PCA(earn, quanti.sup=j_act, ind.sup=i_act, scale=T)
PCA is from FactoMineR library.
Unfortunately I get the following error:
Error in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
invalid string in PangoCairo_Text
However, I don't get an error when I specify graph = FALSE
. So, probably there is some problem with drawing a graph.
I am using Ubuntu 18.04 and R 4.0.
Do you have any idea of how can I fix this?
Solution
In my case, @pathilink is correct. It's caused by non UTF-8 characters in the data. Converting all characters to UTF-8 with the following line fixed my error.
df %>% lapply(., iconv, to = "UTF-8") %>% tibble::as_tibble() %>% ...
Answered By - Pumbaa