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?
Keep the labels from your original file like this:
If you have columns named x and y, you can address them like this:
If you’d like to actually delete the first row from a data.frame, you can use negative indices like this:
If you’d like to delete a column from a data.frame, you can assign NULL to it:
Here are some simple examples of how to create and manipulate a data.frame in R: