How to import a .tsv file How to import a .tsv file r r

How to import a .tsv file


This should do it:

read.table(file = 'drug_info.tsv', sep = '\t', header = TRUE)


Using fread from the package data.table will read the data and will skip the error you are getting using read.table.

require(data.table)data<-as.data.frame(fread("drug_info.tsv"))


You can treat the data like a csv, and specify tab delimination.

read.csv("drug_info.tsv", sep = "\t")