Re: [R] Extract names from vector according to their values

2011-08-02 Thread Dennis Murphy
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" >

Re: [R] Extract names from vector according to their values

2011-08-02 Thread Jean V Adams
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: >

Re: [R] Extract names from vector according to their values

2011-08-02 Thread David Winsemius
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

[R] Extract names from vector according to their values

2011-08-02 Thread Sverre Stausland
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"