Datasets from loaded packages

2 views
Skip to first unread message

Felipe Carrillo

unread,
Oct 3, 2010, 12:34:19 PM10/3/10
to Deducer
Hi:
I read about Deducer when it first came out but I just now gave it a
try. I have to say that it is
a great way for newbies to plot their data without having to type or
know anything about R. I do have
a couple of questions though;
1 - Is there a way to see the code generated when a user clicks on the
any of the menus?
2- Rcmdr has a dropdown combo box where the user can select datasets
from loaded packages to practice; does Deducer have that option? If
not, could that be included?
I am just now started my first session of Deducer and at first glance
it looks awesome but I didn't see the options mentioned above. Thanks
Ian for the great work.

Ian Fellows

unread,
Oct 3, 2010, 2:19:52 PM10/3/10
to ded...@googlegroups.com
Hi Filipe,

On Sun, Oct 3, 2010 at 9:34 AM, Felipe Carrillo
<mazatla...@yahoo.com> wrote:
> Hi:
> I read about Deducer when it first came out but I just  now gave it a
> try. I have to say that it is
> a great way for newbies to plot their data without having to type or
> know anything about R. I do have
> a couple of questions though;
> 1 - Is there a way to see the code generated when a user clicks on the
> any of the menus?

The code is sent to the console when you hit 'Run', so you can see it
there. In the plot builder there is a menu item 'view call' that
displays the generated code.

> 2- Rcmdr has a dropdown combo box where the user can select datasets
> from loaded packages to practice; does Deducer have that option? If
> not, could that be included?

There currently is not, but it is very easy to implement. Here is the code:

.makePackageDataDialog <- function(){
dat <- data()$results
RFunction <- J("org.rosuda.deducer.widgets.param.RFunction")
RFunctionDialog <- J("org.rosuda.deducer.widgets.param.RFunctionDialog")
ParamCharacter <- J("org.rosuda.deducer.widgets.param.ParamCharacter")

rf <- new(RFunction,"data")
rf$setTitle("Load Data From Package")

p <- new(ParamCharacter,"data")
p$setTitle("Data set")
p$setOptions(dat[,3])
p$setLabels(dat[,4])
p$setViewType(p$VIEW_COMBO)
rf$add(p)

rfd <- new(RFunctionDialog, rf)
rfd$setSize(250L,125L)
rfd$setLocationRelativeTo(.jnull())
rfd
}

jgr.insertMenuItem("File","Load Package Data Set",
".makePackageDataDialog()$run()",3)

I will include this dialog in the next version of the DeducerExtras package.

Ian

Felipe Carrillo

unread,
Oct 3, 2010, 2:51:37 PM10/3/10
to ded...@googlegroups.com
Thanks Ian:
Is the new menu created under Data in the JGR console or
should pop up as a new combobox. The reason I am asking is
because I ran the function and can't see it anywhere.
 
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA

Ian Fellows

unread,
Oct 3, 2010, 2:56:36 PM10/3/10
to ded...@googlegroups.com
The code I sent creates a menu item in the file menu.

ian

On Sun, Oct 3, 2010 at 11:51 AM, Felipe Carrillo

Felipe Carrillo

unread,
Oct 3, 2010, 2:59:43 PM10/3/10
to ded...@googlegroups.com
Thanks, just found it.

Felipe Carrillo

unread,
Oct 3, 2010, 5:49:44 PM10/3/10
to ded...@googlegroups.com
It works really well, however is there a way to modify the function
to display only the datasets for the loaded packages? The combobox
displays datasets that is hard to tell which package it belongs to.

Ian Fellows

unread,
Oct 3, 2010, 6:06:27 PM10/3/10
to ded...@googlegroups.com
It should only show data from loaded packages. type data() into the
console to see where the datasets come from.

ian

Reply all
Reply to author
Forward
0 new messages