Web User a écrit :

> 1.) Is there a way to convert a table (e.g. represented as a data frame) 
> to a function, specifying which columns are input and which column is 
> output?  It would seem that this would be useful for plotting 
> experimental results, since e.g. contour(x, y, f) requires f to be a 
> function.

I think on something rather ugly.
Hopefully somebody will propose a more elegant solution.

1/ store your data in a global array myexpresults[,]
2/ define f(x,y) as
f function(x,y) {return(myexpresults[x,y]);};

x,y are integers and f is discrete in the above case.
But if you want to allow x,y continuous,
you can also interpolate in f() with the grid results
the nearest from (x,y).

You can also do it without a global, by reading your table directly
in f(), but this will demand to reread the table each time f is called
which may be rather impracticable.

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to