[R] choosing a particular object

Adrian DUSA adi at roda.ro
Fri Mar 31 11:44:58 CEST 2006


Hello all,

I'd like to create a function which would do some analysis on a particular 
object, which should be specified in advance. Something like:

> ls()
[1] "aa" "bb" "cc"

Object <- "bb"
var.name <- "q2"
testfunction <- function(obj.name, var.name) {
  temp <- give.me.the.object.called(Object)
  table(temp[, var.name])
}

This should perfom the same thing as:
table(bb$q2)

Is this possible?
TIA,
Adrian

-- 
Adrian DUSA
Romanian Social Data Archive
1, Schitu Magureanu Bd
050025 Bucharest sector 5
Romania
Tel./Fax: +40 21 3126618 \
          +40 21 3120210 / int.101




More information about the R-help mailing list