I have this .csv file and I need to load it in 2 data frames or data tables (see image). How can I do it in R?
CodePudding user response:
You can use the read.table()
function, which has the skip
and nrows
arguments. With skip
you can skip as many rows as you want and with nrows
you can say how many rows you want to read into R. Then you can use the function twice with those arguments in order to read the portions you want.
So you may use something like this:
first_table <- read.table(file = "your_file.csv", nrows = 5, sep = ",")
second_table <- read.table(file = "your_file.csv", skip = 7, sep = ",")