I'm having difficulty properly reducing line numbers in a data frame.
I have a dataset named "mydata" that I imported from a text file using R. A data frame has about 200 rows with 10 columns.
I deleted line number 3, 7, 9, 199 using:
mydata <- mydata[-c(3, 7, 9, 199),]
When I run this command, line 3,7,9,199 disappeared from the list, but the line number does not automatically decrease to 196, but remains at 200. It seems to me that some line numbers are attached to each "line" as part of a data frame?
How to fix this problem?
What else puzzles me, when I import a text file using R Studio, I have no problem. (I see when I run the command above). But when using R, I cannot change the line number in the data frame that matches the actual number of lines in the list.
Can someone tell me how to fix this?
source share