0
Good afternoon
I would like to import a file, and I will post an example to be helped It consists of names with space and number separations
To help me with the solution, please copy this information to Excel and to save it in txt separated by tabs, or in some other txt format that solves the problem
dados numero nome
rua joao 15 Joao Inep
rua maria 25 Maria Suiço
rua dois 35 Fernando José
This file is in Excel, and when saving it in txt separated by tabs and trying to import to R, there is a problem regarding the existing spaces within each field
I’d like some help importing it
I tried to import by selecting everything in excel and using the command
dados<-read.table('clipboard', h=T)
also tried using the same code
dados<-read.table(ENDEREÇO DO ARQUIVO NO MEU COMPUTADOR.TXT, h=T)
Thanks in advance
Henrique, which code you used to import the file and which output is error?
– bbiasi
good afternoon, I edited the question with the information, thanks for the availability
– Henrique Faria de Oliveira
Try this:
read.table(file, header = T, sep = "")
– bbiasi
'Error in read.table("Clipboard", h = T, Sep = "") : more Columns than column Names'
– Henrique Faria de Oliveira
If you routinely need to read Excel files in R, try the readxl package: https://cran.r-project.org/web/packages/readxl/
– Carlos Eduardo Lagosta
thanks for the indication, however I would like to import the file through a txt, containing the described information
– Henrique Faria de Oliveira
Did you save it in Excel to . txt as tab-separated text? If so, this worked here:
clipboard <- read.delim("C:/Users/BRENNER BIASI/Desktop/clipboard.txt")
– bbiasi
Solved, thank you very much for the help, if you want to comment as a response to evaluate as a solution for you score
– Henrique Faria de Oliveira