Hi,
Can anyone please tell me how to use a argument of a function after $
sign of a data frame.That argument is one of the column name of the data
frame.
Thanks,
Madhvi
__
R-help@r-project.org mailing list
I don't believe I understand your question, but here it goes.
dat - data.frame(x = rnorm(100), y = runif(100))
mean(dat$x)
Hope this helps,
Rui Barradas
Em 13-08-2014 12:33, madhvi.gupta escreveu:
Hi,
Can anyone please tell me how to use a argument of a function after $
sign of a data
Use [[ instead of $. E.g.,
f - function(columnName) {
d - data.frame(x=1, y=2, z=3)
d[[columnName]]
}
f(z) # 3
cName - y
f(cName) # 2
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Aug 13, 2014 at 4:33 AM, madhvi.gupta madhvi.gu...@orkash.com wrote:
Hi,
Can anyone please tell
3 matches
Mail list logo