Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to order the dataframe in a list

Sorry for a silly question. I have a lst lbsl_lst which contain multiple df. I would like to rearrange the order of df appear in the lst as :
JP002A-0002, JP002A-0003, JP007A-0001, JP002A-0001. what should I do in order to achieve this so lbsl_lst[[3]] will be JP007A-0001?

Thanks.

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I don’t see a programmable logic to the order of namnes, but you could reorder based on their current indices:

lbsl_lst = lbsl_lst[c(2, 3, 4, 1)]

Or based on their names:

lbsl_lst = lbsl_lst[c("JP002A-0002", "JP002A-0003", "JP007A-0001", "JP002A-0001")]
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading