randy3k / radian

A 21 century R console
MIT License
1.96k stars 73 forks source link

Problem in using read.table() by radian while it could be run normally in R gui #454

Open SkrHo opened 6 months ago

SkrHo commented 6 months ago

After updating radian, when I used read.table() in a for loop, an error came up.

r$> for (i in 1:(length(files))) { x <- read.table(file = files[i], header = T, sep = ",", row.names = 1) x <- x[, -c(2, 4, 5, 9, 12, 13)] x <- t(x) assign(filelist_sampled[i], x) rm(x) } Error in read.table(file = files[i], header = T, sep = ",", row.names = 1) : no lines available in input In addition: Warning message: In read.table(file = files[i], header = T, sep = ",", row.names = 1) : invalid input found on input connection 'my file name'

This code could be used in the R GUI and old version of radian.

SkrHo commented 6 months ago

I already confirmed my csv files and their directory. Both should be OK.

SkrHo commented 6 months ago

It was the encoding problem. I followed this issue and set the local encoding to UTF-8, problem solved. https://github.com/randy3k/radian/issues/269