Donatas Kiznis Donatas Kiznis - 3 months ago 28
R Question

How to read utf-8 encoded text in R

I'm importing .xlsx files in to R and when I enter print data command I get a mess with specific symbols. The file opens nicely with excel. This is the code I use:

data <-read.xlsx("file.xlsx", sheetIndex = 1)


I don't have access to your data so I cannot check:

data <- xlsx::read.xlsx("file.xlsx", sheetIndex = 1, encoding="UTF-8")