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 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.