Hi all,
Suppose I hve this vector:
x
[1] 3 4 7 17 22 12 15 12 3 3 1 1
How can I remove the top-3 element.
Yielding only:
[1] 17 22 12 15 12 3 3 1 1
- Gundala Viswanath
Jakarta - Indonesia
__
R-help@r-project.org mailing list
try this:
x[-(1:3)]
# or
tail(x, -3)
Best,
Dimitris
Gundala Viswanath wrote:
Hi all,
Suppose I hve this vector:
x
[1] 3 4 7 17 22 12 15 12 3 3 1 1
How can I remove the top-3 element.
Yielding only:
[1] 17 22 12 15 12 3 3 1 1
- Gundala Viswanath
Jakarta - Indonesia
-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
Namens Gundala Viswanath
Verzonden: woensdag 18 februari 2009 9:20
Aan: r-h...@stat.math.ethz.ch
Onderwerp: [R] Remove top-K elements in Vector
Hi all,
Suppose I hve this vector:
x
[1] 3 4 7 17 22 12 15 12
3 matches
Mail list logo