Could anyone please explain to me why the following function call returns 'NULL' instead of 1?
> df <- data.frame(1,2,3)
> df
X1 X2 X3
1 1 2 3
> f <- function(vdf, vx) { return (vdf$vx); }
> f(df, "X1")
NULL
>
Could anyone please explain to me why the following function call returns 'NULL' instead of 1?
> df <- data.frame(1,2,3)
> df
X1 X2 X3
1 1 2 3
> f <- function(vdf, vx) { return (vdf$vx); }
> f(df, "X1")
NULL
>