Home > front end >  Can I place a .tsv file within a vectr in R?
Can I place a .tsv file within a vectr in R?

Time:01-04

I want to read a tsv file with a lot of numbers. Is it possible to put it inside a vector? Like, now I can manually place numbers in my vector, but can I just put the file inside the vector, so i takes all the values from the file?

my_vector <- c(1, 3, 7, 2, 6)

My idea was that I could write something like

my_vector <- c("my_file.tsv")

But it doesn't work. Is there a way to do it?

CodePudding user response:

You could use:

unname(unlist(read.table("temp.tsv", sep="\t")))
  •  Tags:  
  • rcsv
  • Related