Problem in using read.table() by radian while it could be run normally in R gui
SkrHo opened this issue · 2 comments
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.
I already confirmed my csv files and their directory. Both should be OK.
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