I have ordered a set of rows to get this:
2 1983 TRI-COUNTY TRAUTH 0.1495 0.1395 NA 452 0.0764 4 0 06/02/83 4 1983 TRI-COUNTY TRAUTH 0.1193 0.1113 NA 32 0.0764 4 2 07/20/83 14 1983 TRI-COUNTY TRAUTH 0.1064 0.1064 NA 26 0.0763 6 2 08/03/83 17 1983 TRI-COUNTY TRAUTH 0.1110 0.1010 0.1010 176 0.0763 7 4 08/08/83 24 1983 TRI-COUNTY TRAUTH 0.1293 0.1215 NA 452 0.0763 4 0 09/12/83 41 1984 TRI-COUNTY TRAUTH 0.1325 0.1225 NA 452 0.0740 4 0 06/20/84 45 1984 TRI-COUNTY TRAUTH 0.1425 0.1325 NA 32 0.0741 4 2 07/17/84 47 1984 TRI-COUNTY TRAUTH 0.1395 0.1395 0.1250 91 0.0741 14 11 07/16/84
But I want to renumber these such that its 1,2,3,4,etc...
Can someone please help?
Are you just looking for something like this?:
row.names(datasetname) <- 1:nrow(datasetname)
Alternatively, if the first column in your example data is a variable (say V1
) in a dataframe and not the row.names
, this will work:
datasetname$V1 <- 1:nrow(datasetname)
This is the easiest way to do it:
rownames(dataset) = NULL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With