R - How to re-order row index number
23,117
You can use
row.names(yourdf) <- NULL
to reset the row names
Related videos on Youtube
Author by
mtleis
Computer Scientist / Bioinformatician; expert in software development, computer vision and data science. Has experience with various image processing and data mining tools, as well as software engineering. Motivated and interested to work in a domain close to software development and machine learning. Independent, creative, hard-working and very collaborative. Specialties: Image Analysis, Data Analysis, Software Development and Bioinformatics,
Updated on June 13, 2020Comments
-
mtleis over 3 years
Simply put, I have the following data frame:
Signal 4 9998 3 549 1 18 5 2.342 2 0.043
and I want to reset the index numbers to be like :
Signal 1 9998 2 549 3 18 4 2.342 5 0.043
-
akrun over 8 yearsTry
yourdf <- yourdf[order(-yourdf$Signal),, drop=FALSE];row.names(yourdf) <- NULL
-