I'm a new R user. I've just tried to import text file in R. When I used 'import dataset' it opened columns but every value were 'N/A'. Then I used to import by code. I used the following code
ds<-read.table("C:/Path/name.txt",header=TRUE,sep=","), but it opens just one column where values are not shown again. It's opened nicely in excel but not in R.
Could you please suggest any solution to this problem?
Thank you in advance.
As I see it's comma. When I opened it in excel, I used comma as a delimiter and it worked so I use comma as a delimiter in R as well but it does not work even when I use read_delim function.
Can you also check if your data starts from the first row & column or do you have some merged cells or some additional texts at the start of the excel sheet?
Most likely the function read.table or readr::read_* is not able to find the delimiter and hence getting your data in the first column.
Excel merged cells and hidden rows/columns have tripped me multiple times in the past !