> ruipbarra...@sapo.pt
> Maybe the following (untested).
>
> table(df$Protocol[df$Speed == "SLOW"])
Could also use which.max to get the particular item: ...
tprot <- table(df$Protocol[df$Speed == "SLOW"])
tprot[which.max(tprot)]
S Ellison
*
Hello,
Maybe the following (untested).
table(df$Protocol[df$Speed == "SLOW"])
Hope this helps,
Rui Barradas
Citando ch.elahe via R-help :
> Hi all,
> I have the following df:
>
> $ Protocol : Factor w/ 48 levels "DP FS QTSE SAG",..: 2 3
> 43 42 31 36 37 30 28 5 ...
>
> $ Speed
Hi all,
I have the following df:
$ Protocol : Factor w/ 48 levels "DP FS QTSE SAG",..: 2 3 43 42 31 36
37 30 28 5 ...
$ Speed : chr "SLOW" "SLOW" "SLOW" "VerySLOW" ...
How can I get the most frequent Protocol when Speed is "SLOW"?
Thanks for any help!
Elahe
_
3 matches
Mail list logo