I cannot load csv file

cfreq<-read.csv("final.csv",header=FALSE,fileEncoding = "utf-8")

this is the current code that I am using and when I run it I get the error

Error in read.table(file = file, header = header, sep = sep, quote = quote, :
no lines available in input
In addition: Warning message:
In read.table(file = file, header = header, sep = sep, quote = quote, :
invalid input found on input connection 'final.csv'

The csv file only contains these numbers below on the first column so I'm not sure what this error means. If anyone can help me out that will be great! thank you !!

27 37 4 7 16 24 25 6 18 41 16 9 6 9

That file is not coma separated.

You have a number of choices

Your could add sep=" " to your parameters.

You could use read.table

Hello thank you for responding !

This is completely my fault as I did not clarify in the original post but I also tried the code below and got this error.

cfreq<-read.table("final.csv",header=FALSE, sep=",", nrows=-1)
Error in type.convert.default(data[[i]], as.is = as.is[i], dec = dec, :
invalid multibyte string at 'サ27'

Do you know what the multibyte thing is?

You may have a tab-separated file.
sep = "\t", might work.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.