Configure Deducer to output data-set changes to Rstudio

44 views
Skip to first unread message

Aaron Wichman

unread,
Oct 30, 2015, 2:29:44 PM10/30/15
to Deducer

Hi All:


Please forgive what may be an ignorant question.


Is there a way to configure Deducer to output to Rstudio?


Specifically, a way to get changes made to data within Deducer automatically reflected in Rstudio’s representation of the same data set? something I like about Rcommander is that changes made to data within Rcommander automatically are reflected in Rstudio’s representation of the data set. That is, if I add a variable to data set Foo in Rcommander, it appears if I type ” names (Foo) “ within Rstudio. This is not the case with Deducer.


Is there a way to

1.)   1.) configure Deducer so that its operations on data are automatically reflected when those data are accessed within Rstudio?

2.) 2.)    Configure Deducer so that Deducer Menu-generated scripts automatically output to a script window in Rstudio?

3.)  3.)   Configure Deducer so that output is shown within Rstudio?


I care the most about point 1. I want to be able to operate on the same data across Rstudio, Rcommander, and Deducer, and I want Deducer-initiated operations to be reflected in Rstudio in particular.

Any advice is appreciated.


Thanks much,


Aaron

Aaron Wichman

unread,
Nov 2, 2015, 4:43:45 PM11/2/15
to Deducer
Update to previous post:
    It appears to be quite difficult to get Deducer to work directly with Rstudio. Further, configuring Rstudio to do this would be contrary to Rstudio's mission of providing an efficient R-coding environment.
    So: I have a suggested work-around that leads to a productive question. I welcome any advice.

1.) open the basic RGUI; open Rstudio
2.) open the data you are working with "MyData" into both RGUI and Rstudio, using the same working directory.
2.) load Deducer into the RGUI; this opens Deducer's menu options in the RGUI.
3.) load Deducer into Rstudio, but do not open JGR
4.) Access Deducer menus through RGUI and run menu-generated script.
5.) Copy and paste this script into Rstudio, where you can run it because the Deducer package has been loaded.

One of several problems with this is that changes made in RGUI to MyData will not automatically propagate to MyData as it is present in the Rstudio global environment.
To solve this, MyData have to be saved in RGUI and then reopened within Rstudio.
Do this using the Deducer menu to save data, whereby the command generated is of the form: save(MyData, file='C:/Aaron/MyData.Ranalyses/MyData.RData')

I believe that this command saves the data object into the MyData.RData workspace file. It doesn't overwrite the entire file--just puts the MyData object into it. (I could be wrong on this)

In Rstudio, re-open MyData. This will overwrite the older MyData file in the Rstudio global environment, replacing it with the file just modified by Deducer from within the RGUI.
I'm not sure if there are dangers to replacing the MyData object

This procedure is ungainly.

So here's the productive question: Does anyone have an idea for how I could pipe syntax generated by Deducer from within the RGUI into Rstudio, where I could run it?
Further, does anyone have an idea for how to ensure that any data that Deducer operates on from within RGUI are the most current form of the data? This most current form should reflect whatever changes were just made to the data from within Rstudio.

Basically, the code would need to check for the current version of MyData before opening the Deducer menu, then pipe whatever script is generated by the Deducer menu into Rstudio. I think that Rstudio would have to save the MyData object each time after any changes were made to it so that the RGUI could get the current version of the MyData object.

Many thanks,

Aaron

Ian Fellows

unread,
Nov 4, 2015, 12:00:36 PM11/4/15
to ded...@googlegroups.com
Hi Aaron,

Yes, it is very ungainly to get several IDEs to work on a single dataset. Deducer is really best used within JGR. I understand the impulse to work in the popular RStudio IDE, but (the GUI part of) Deducer is simply not designed for it.


Best,
Ian

--

---
You received this message because you are subscribed to the Google Groups "Deducer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deducer+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aaron Wichman

unread,
Nov 4, 2015, 1:25:12 PM11/4/15
to ded...@googlegroups.com
Thank you very much for your response, Ian.
It turns out that a better work-around is to save the dataset within Deducer as  .rda file, not .robj.
So: operate on data in Deducer, then save data as .rda and open this file in Rstudio when I want to use Rstudio. (I believe Rstudio's data viewer has trouble rendering .robj files, so .rda works best if you want to see your data).
After manipulating data in Rstudio, save it as .rda, and reopen in Deducer.

Something that would make this very easy is a shortcut command to save data to .rda in Deducer, and perhaps a shortcut command to refresh data in Deducer. This would allow someone who had altered data in another utility to nearly immediately work on the current data file within Deducer, after running the shortcut command from the Deducer command line.

I'd like to write a function Rstudio to save the active data file as .rda so that I can operate on it in Deducer after ensuring that Deducer is working with the updated data file. (call it "save file": sF(my.data) or something. A shortcut key like ctrl+sf would be even better.

Put more coherently, my wishlist to make this work-around easy would be
  a tool  to automatically or via short-cut key combination save Deducer data set to .rda
  a tool to automatically or via short-cut key combination refresh the Deducer .rda data set.
 
The matching tools in Rstudio.
With these, the two programs could be used side-by-side, pretty effectively, I think.

I don't want to impose any more than I already have, but do you know a way to create these automatic save and refresh tools in Deducer or Rstudio? Like many people using R, my current skill with it considerably lags my desired skill level with it. But I'm closing the gap.

Thank you.

Aaron

--
****************************************
Aaron Wichman

Department of Psychological Sciences
Western Kentucky University
3028 Gary Ransdell Hall
1906 College Heights Blvd., #21030
Bowling Green, KY 42101-1030

Phone: (270) 745-3919
Fax: (270) 745-3475

http://www.wku.edu/psychological-sciences/staff/aaron_wichman

http://sites.google.com/site/wichmana/

New book: Handbook of Personal Security, with Routledge:  http://www.routledge.com/books/details/9781848726758
Reply all
Reply to author
Forward
0 new messages