R - How to re-order row index number

23,117

You can use

 row.names(yourdf) <- NULL

to reset the row names

Share:
23,117

Related videos on Youtube

mtleis
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, 2020

Comments

  • mtleis
    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
      akrun over 8 years
      Try yourdf <- yourdf[order(-yourdf$Signal),, drop=FALSE];row.names(yourdf) <- NULL

Related