0

I want to delete the first row of a tibble. How do I do this? Can someone help?

Input

A  B  C
1  2  3
4  5  6

Output

A  B  C
4  5  6

I tried to do lapply with the subset function (choose from second element onwards) to each column of the tibble but it does not work.

MSR
  • 2,731
  • 1
  • 14
  • 24
user17144
  • 428
  • 3
  • 18
  • 2
    Does this answer your question? [How to delete the first row of a dataframe in R?](https://stackoverflow.com/questions/7541610/how-to-delete-the-first-row-of-a-dataframe-in-r) – MSR Dec 08 '19 at 18:46

1 Answers1

0

You can use

df <- df[-1,]

DATA

df <- structure(list(A = 4L, B = 5L, C = 6L), row.names = c(NA, -1L
), class = c("tbl_df", "tbl", "data.frame"))
ThomasIsCoding
  • 96,636
  • 9
  • 24
  • 81