Francis Smart <fsmart <at> gmail.com> writes:
Is there a wildcard value for vector values in r? For instance:
M <- *wildcard
(M==1)
TRUE
(M=="peanut butter")
TRUE
is.na(M)
FALSE
If grep on a vector does not help, maybe the following comes closer? Finding all variables rm(list=ls(all=TRUE)) a = 33 aa = 44 dd = 33 c = 3 names = "^a.*" Vars <- ls() r <- Vars[grep(names,Vars)] r # not really correct for names.* and Vars.* Dieter