[R] How to findout the name of a dataframe

2013-02-17 Thread Frans Marcelissen
Let'say we have a dataframe mydata with column v1. If mydata$v1 is passed to a function, is there way, then, to extract the name of the dataframe? What I now do is passing the name of the dataframe to the funcion, so passing two parameters. Maybe with mydata$v1 it is not possible, but with

Re: [R] How to findout the name of a dataframe

2013-02-17 Thread jim holtman
Will this work for you: myFunc - function(var){ + # get the dataframe name + charName - deparse(substitute(var)) + # parse out data.frame + dataFrame - sub(\\$.*, , charName) + cat(input:, charName, data.frame:, dataFrame, \n) + } myFunc(mydata$V1) input: mydata$V1

Re: [R] How to findout the name of a dataframe

2013-02-17 Thread David Winsemius
On Feb 17, 2013, at 5:51 AM, Frans Marcelissen wrote: Let'say we have a dataframe mydata with column v1. If mydata$v1 is passed to a function, is there way, then, to extract the name of the dataframe? What I now do is passing the name of the dataframe to the funcion, so passing two