How to skip 2nd row while importing the data in R?

r

#1

I have used the below code to import the csv file. But it removes the top 2 rows. I want only the second row to be removed and I want the header to be there as it is. Can someone please help me?

data = read.csv(“IMDB_data.csv”, header = T, skip = 2)IMDB_data.csv (1.9 MB)

Attached the csv file.


#2

Use this for skip row
read_File = readLines(“filePath”)
dataset = read.csv(textConnection(read_File[-2]), header = TRUE, sep=",")


#3

That worked perfectly. Thanks buddy! :slight_smile:


#4

Easiest way is
Df=(read.csv(“IMDB_data.csv”,header=T,sep=",")[-2,])
Always reduce functions in R as it uses RAM directly. Good luck


#5