[R] Create a function problem

Mathew Guilfoyle mrgu|||oy|e @end|ng |rom gm@||@com
Sat May 15 08:26:58 CEST 2021

Have you tried putting the a,b, and c column names you are passing in quotes i.e. as strings? Currently your function is expecting separate objects with those names.

The select function itself can accept unquoted column names, as can others in R, because specific processing they do in the background.  Your wrapper function doesn’t have that facility.  I have a very limited understanding of the details to explain this but it is one of the ‘gotchas’ when starting.

No doubt others will point out that the approach you are using is probably not the best (lacks flexibility; some column names are hard coded etc), but if it gets the job done, to some extent that’s all that matters.

> On 14 May 2021, at 23:06, Kai Yang via R-help <r-help using r-project.org> wrote:

More information about the R-help mailing list