How to read data from a text file in R?



Hi everyone,

I have a data set that is given in a .txt file. I am not able to find a means to manipulate data from it directly. Please suggest a method to read a text file into R. Can I convert it into .csv format or is it possible to manipulate data directly by reading it from a .txt file? If yes, please suggest some resource or piece of code.

Any help would be appreciated!


you can use read.table command in R. Below is the example how you can read text file.
a <- read.table("…/test.txt", sep = “\t”)


Thank you @saurabh090909