In theory, any .txt file can be imported into R
. Try running the
dados <- read.table(file="NomeDoArquivo.txt", header=TRUE, sep="\t")
where
-
file="NomeDoArquivo.txt"
is the name of the file to be imported
-
header=TRUE
informs you that NomeDoArquivo.txt
has a header. If NomeDoArquivo.txt
does not have header, change argument to header=FALSE
-
sep="\t"
is the file's column separator. Since read.csv
is not working, I guess the column separator is a tab stop. Other common options for sep
are ,
, ;
and " "
(space).
Finally, run
dim(dados)
str(dados)
and see if the number of rows and columns reported is as expected and if the data type in each column is correct. If all goes well, the data set was imported correctly. If it does not work (or if the code above does not work), come back here to try to figure out what to do together.