[kepler-dev] [Bug 2964] - Change RExpression plotting actors to allow custom axis and title labels
bugzilla-daemon at ecoinformatics.org
Mon Feb 11 13:45:15 PST 2008
------- Comment #1 from leinfelder at nceas.ucsb.edu 2008-02-11 13:45 -------
using R "attributes" of objects, we can add some metadata to the variables as
the tokens are made available in R.
In the case of the ScatterPlot-RExpression actor that has 2 input ports named
"Independent" and "Dependent" the X- and Y-axis are labeled with those
If we included a "name" attribute for each of those objects, we could use that
attribute as the axis label when calling plot() in R.
I propose using the upstream (source) output port name as the "name" attribute.
In the case of an EML actor that provides two vectors of data (columns) for
the ScatterPlot, each axis would be labeled with the column name that provided
the data being plotted.
The R for creating the graph would look like this:
plot(Independent, Dependent, xlab=attributes(Independent)$name,
If the R actor class does make this "name" attribute available to script
authors in Kepler, there is no need for it to be used unless desired. The R
for adding these custom attributes is also quite straight forward:
attr(z, "name") <- "temperature"
sets the name attribute of object, z, to "temperature. that's it!
More information about the Kepler-dev