Skip to content
Prev 365841 / 398502 Next

Write a function that allows access to columns of a passed dataframe.

When you use that calling syntax, the system will supply the values of whatever the `age` variable contains. (And if there is no `age`-named object, you get an error at the time of the call to `myfun`. You need either to call it as:

myfun( mydf , "age")


# Or:

age <- "age"
myfun( mydf, age)

Unless your value of the `age`-named variable was "age" in the calling environment (and you did not give us that value in either of your postings), you would fail.

Thread (21 messages)

John Sorkin Write a function that allows access to columns of a passed dataframe. Dec 5 Rui Barradas Write a function that allows access to columns of a passed dataframe. Dec 5 Rui Barradas Write a function that allows access to columns of a passed dataframe. Dec 5 John Sorkin Write a function that allows access to columns of a passed dataframe. Dec 5 Bert Gunter Write a function that allows access to columns of a passed dataframe. Dec 5 Rui Barradas Write a function that allows access to columns of a passed dataframe. Dec 5 Rui Barradas Write a function that allows access to columns of a passed dataframe. Dec 5 David Winsemius Write a function that allows access to columns of a passed dataframe. Dec 5 Rui Barradas Write a function that allows access to columns of a passed dataframe. Dec 5 David Winsemius Write a function that allows access to columns of a passed dataframe. Dec 5 Bert Gunter Write a function that allows access to columns of a passed dataframe. Dec 5 Bert Gunter Write a function that allows access to columns of a passed dataframe. Dec 5 Bert Gunter Write a function that allows access to columns of a passed dataframe. Dec 5 Rui Barradas Write a function that allows access to columns of a passed dataframe. Dec 6 John Sorkin Write a function that allows access to columns of a passeddataframe. Dec 6 Rui Barradas Write a function that allows access to columns of a passeddataframe. Dec 6 William Dunlap Write a function that allows access to columns of a passeddataframe. Dec 6 Rui Barradas Write a function that allows access to columns of a passeddataframe. Dec 6 William Dunlap Write a function that allows access to columns of a passeddataframe. Dec 6 David Winsemius Write a function that allows access to columns of a passeddataframe. Dec 6 Bert Gunter Write a function that allows access to columns of a passeddataframe. Dec 6