Tweak the object browser?

5 views
Skip to first unread message

Helios De Rosario

unread,
Mar 21, 2012, 7:03:17 PM3/21/12
to Deducer
Hi,

The input for most (if not all) Deducer dialogs are data frames. But
users may also want to use variables stored in objects of other
classes. For instance, after fitting a model it is useful to calculate
some descriptives of the residuals, but if they are not stored in a
data frame, they are not "visible" by the Deducer dialogs that
facilitate those calculations.

Well, this specific example is not very good, because the "Linear
model" dialog has an option for exporting the residuals to a data
frame, and this solves the issue. But I hope you understand my point.

The easiest solution is to coerce those objects to data frames with
the function as.data.frame(), but for many potential users of Deducer
it would be convenient to have some "point and click" dialog to do
that.

Of course, there is the possibility of creating a dialog that lists
all the objects of the workspace, and a button to apply
as.data.frame() to the selected objects, but it would be nice to use
the already available tools, instead of creating a dialog from
scratch.

JGR already has an "Object browser" where you can explore all the
objects of the workspace, and in some cases export their contents to
text files. So I wonder:

Is there a feasible way of adding a button or a menu item to the
Object browser, associated to the action of trying to apply
"as.data.frame" to the selected object, or alternatively opening an
auxiliary dialog to do that operation? Could this be done with Deducer
tools?

Regards,
Helios

Ian Fellows

unread,
Mar 27, 2012, 2:50:14 PM3/27/12
to ded...@googlegroups.com
Helios,

On Wed, Mar 21, 2012 at 4:03 PM, Helios De Rosario
<helios.d...@gmail.com> wrote:
> Hi,
>
> The input for most (if not all) Deducer dialogs are data frames. But
> users may also want to use variables stored in objects of other
> classes. For instance, after fitting a model it is useful to calculate
> some descriptives of the residuals, but if they are not stored in a
> data frame, they are not "visible" by the Deducer dialogs that
> facilitate those calculations.
>
> Well, this specific example is not very good, because the "Linear
> model" dialog has an option for exporting the residuals to a data
> frame, and this solves the issue. But I hope you understand my point.
>
> The easiest solution is to coerce those objects to data frames with
> the function as.data.frame(), but for many potential users of Deducer
> it would be convenient to have some "point and click" dialog to do
> that.
>
> Of course, there is the possibility of creating a dialog that lists
> all the objects of the workspace, and a button to apply
> as.data.frame() to the selected objects, but it would be nice to use
> the already available tools, instead of creating a dialog from
> scratch.

Another option is to use object chooser widget in the dialogs instead
of the variable selector. In your example, you would restrict the
classes shown in the widget to "lm" and perform descriptives on the
selected object. Note also that the VariableSelector can be adapted to
work with non-data.frame objects, though it must be done on the Java
side. DeducerSpatial has an example of this (the
SpatialVariableSource).

>
> JGR already has an "Object browser" where you can explore all the
> objects of the workspace, and in some cases export their contents to
> text files. So I wonder:
>
> Is there a feasible way of adding a button or a menu item to the
> Object browser, associated to the action of trying to apply
> "as.data.frame" to the selected object, or alternatively opening an
> auxiliary dialog to do that operation? Could this be done with Deducer
> tools?

There is. Currently the object browser has an 'export to r' option,
but it does not convert data types. you could add this option, but you
would have to do this in Java.

Ian

Reply all
Reply to author
Forward
0 new messages