I am trying to use the pheatmap package and getting this error. It happened initially on my data but it reproduces for me with the package sample code:
install.packages("pheatmap")
library("pheatmap")
test = matrix(rnorm(200), 20, 10)
test[1:10, seq(1, 10, 2)] = test[1:10, seq(1, 10, 2)] + 3
test[11:20, seq(2, 10, 2)] = test[11:20, seq(2, 10, 2)] + 2
test[15:20, seq(2, 10, 2)] = test[15:20, seq(2, 10, 2)] + 4
colnames(test) = paste("Test", 1:10, sep = "")
rownames(test) = paste("Gene", 1:20, sep = "")
pheatmap(test)
Error in pdf(file = NULL) : failed to load default encoding
In addition: Warning message:
In pdf(file = NULL) : failed to load encoding file 'ISOLatin1.enc'
Someone had a related question on Stack Overflow:
The weird thing is I can start a fresh project in R studio and the pheatmap code works. I tried projects with and without spaces in their working directory path but that didn't make a difference. I also checked pdf.options(), and that is identical in the project giving the error and the one that works.