separate columns and remove the letter t

-2
  

Given

asked by anonymous 08.01.2018 / 15:36

2 answers

2

Try to modify the tab. In your case, through the output, the comma is not the column separator.

dados<-read.table("especies identificadas.txt",header=T,sep="\t")
    
08.01.2018 / 15:58
1

The problem is that by putting "\ t" as a function parameter, R recognizes it as a tab symbol (the popular "Tab" on the keyboard) and therefore does not recognize its tab. However, typing "\\ t" (so that it recognizes the metacharacter as text) does not accept read.table because the separator can only be one character. I made a modification to your file (if it is possible) to replace the "\ t" with "|" and I used the code:

dados <- read.table("especies_identificadas.txt", header = F, sep = "|")
    
09.01.2018 / 13:26