How to delete the first row of a dataframe in R?
问题 I have a dataset with 11 columns with over a 1000 rows each. The columns were labeled V1, V2, V11, etc.. I replaced the names with something more useful to me using the "c" command. I didn't realize that row 1 also contained labels for each column and my actual data starts on row 2. Is there a way to delete row 1 and decrement? 回答1: Keep the labels from your original file like this: df = read.table('data.txt', header = T) If you have columns named x and y, you can address them like this: df$x