I'm sorry about this newbie question. I have a data frame like
l_tab$dis2_num$perc
Var1 dis pol dif
1 1 0.79867550 0.2198391 0.57883635
2 2 0.14569536 0.1983914 0.05269606
3 3 0.05562914 0.5817694 0.52614030
Where I would like to find the min value of dif. I have try this:
> min(l_tab$dis2_num$perc["dif"])
>[1] 0.05269606
And that's correct, but i would like to recover also the row (in this case 2)
Searching for this stuff, i have try this:
Sorting and finding values in other data frames
that recommends the function which.min().
The problem arise when i try to apply this to my data
> which.min(l_tab$dis2_num$perc["dif"])
Erreur dans which.min(l_tab$dis2_num$perc["dif"]) :
the objet (list) can't be converted to type 'double'
> typeof(l_tab$dis2_num$perc)
[1] "list"
I don't understand why my data frame has become a list.
Also I have tried this
> r = as.data.frame(r)
> r
Var1 dis pol dif
1 1 0.79867550 0.2198391 0.57883635
2 2 0.14569536 0.1983914 0.05269606
3 3 0.05562914 0.5817694 0.52614030
> typeof(r)
[1] "list"
without any result...