Kaja
Kaja

Reputation: 3057

r not reading the first row of csv file

I am trying to read a bi csv file with this simple command:

k<-read.csv("/home/babak/BB/Data.csv")[,1:10]

If I am showing the k. I see this output

2      523  587  575  394  444  491  471  448  555  587
3      539  602  588  399  443  479  483  466  554  571
4      531  608  592  391  467  486  475  468  555  576
5      540  582  582  403  452  467  459  454  542  587
6      539  599  575  398  467  492  463  471  573  579
7      529  591  582  395  456  491  472  455  543  579
...    ...  ...  ...  ...  ...  ...  ...  ...  ...  ...

here I don't see the first row, and the result begins from the second row. would you please help me to solve this problem?

Upvotes: 3

Views: 2779

Answers (2)

Jaap
Jaap

Reputation: 83215

Try:

k <- read.csv("/home/babak/BB/Data.csv", header = FALSE)[,1:10]

Upvotes: 1

Sven Hohenstein
Sven Hohenstein

Reputation: 81683

Use the argument header = FALSE:

read.csv("/home/babak/BB/Data.csv", header = FALSE)

Upvotes: 7

Related Questions