Sunday, 11 August 2013

How do you delete the header in a dataframe?

How do you delete the header in a dataframe?

I want to delete the header from a dataframe that I have. I read in the
data from a csv file then I transposed it, but it created a new header
that is the name of the file and the row that the data is from in the
file.
Here's an example for a dataframe df:
a.csv.1 a.csv.2 a.csv.3 ...
x 5 6 1 ...
y 2 3 2 ...
I want to delete the a.csv.n row, but when I try df <- df[-1,] it deletes
row x and not the top. Thanks in advance.

No comments:

Post a Comment