Hi:
One more possibility:
> names(my.vector[grep('recommended', my.vector)])
[1] "Matrix" "boot" "class" "cluster""codetools"
[6] "foreign""KernSmooth" "lattice""MASS" "Matrix"
[11] "mgcv" "nlme" "nnet" "rpart" "spatial"
[16] "survival"
>
WI 54409 USA
From:
Sverre Stausland
To:
r-help@r-project.org
Date:
08/02/2011 01:24 PM
Subject:
[R] Extract names from vector according to their values
Sent by:
r-help-boun...@r-project.org
Dear helpers,
I can create a vector with the priority of the packages that came with
R, like this:
>
On Aug 2, 2011, at 2:21 PM, Sverre Stausland wrote:
Dear helpers,
I can create a vector with the priority of the packages that came with
R, like this:
installed.packages()[,"Priority"]->my.vector
my.vector
base boot class cluster codetools
"base" "re
Dear helpers,
I can create a vector with the priority of the packages that came with
R, like this:
> installed.packages()[,"Priority"]->my.vector
> my.vector
base boot class cluster codetools
"base" "recommended" "recommended" "recommended" "recommended"
4 matches
Mail list logo