[R] Using %variable% object-column names in function

achilleas.psomas@wsl.ch achilleas.psomas at wsl.ch
Wed Feb 9 18:12:32 CET 2005


> Dear R-help..
>
> I am rather new in R so i would appreciate your help in my problem..
> I cant seem to be able to write a function that has arguments being  objects
> and
> column names of these ojbects...
> A simple example code that doesnt work is the following..
>
>
> auto_plot <- function (object1,column1,object2,column2) {
>
>
> plot(object1$column1,object2$column2)
>
> }
>
>
> I get the message:
> Error in xy.coords(x, y, xlabel, ylabel, log) :
>         x and y lengths differ
>
> Maybe the solution is simple but i just couldnt find it..
>
>
> Thanks a lot for your help..
>
> Achilleas.
>
>




More information about the R-help mailing list