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 use which.min() function in a dataframe

I have a dataset with columns and rows and in that dataset I want to extract the minimum water potential value which i did by using the which.min() function which gave me the position of the element present in the data frame but other than that I want the species and the day for that value recorded which codes to use?

>Solution :

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

if I understand it correctly you have a data frame, say df, and which.min(df$water_potential) returns you the position of the observation with the minimum value. What happens if you try something like

df[which.min(df$water_potential),]

to retrieve the other column values for this observation?

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