I take an extract from the data frame DF1 using certain index values ind, do some modifications to the extracted data frame, and then save it as DF2 using the %>% operator. Once I am done, I would like to renumber the entries in DF2:
DF2 <- DF1[ind,] %>% ...do some modifications... %>% row.names() <- NULL
My problem is that the row.names() <- NULL portion does not work. I have to use the code
row.names(DF2) <- NULL
afterwards to renumber the entries in DF2. However, I would like to do this as the last step before assigning the modified data frame to DF2. How can I modify the last portion to accomplish the renumbering from 1 to number of rows? I have tried using mutate, but could not get it to work. Thanks