Plot Builder issues with Templates and Themes going missing

313 views
Skip to first unread message

Kieran Short

unread,
Nov 26, 2012, 10:32:51 PM11/26/12
to ded...@googlegroups.com
Hi all,

As the subject suggests, I'm having a strange problem where a couple of templates and themes have disappeared. One template of note that is no longer available is the Pie chart, and what I think is a rather essential theme, OPTS, is also missing.

Any idea how they can be brought back? 
I'm using the all-in-one installation provided on the wiki, on windows7/64. I uninstalled and re-installed Deducer, but the problem remains. I also have R-studio installed, so after removing deducer there still was an instance of R on this machine.

best regards,
Kieran

Kieran Short

unread,
Nov 26, 2012, 10:35:22 PM11/26/12
to ded...@googlegroups.com
I should add, that all I really want is to insert a title for my plot and as far as I can tell, Opts is (or was?) the way to do it. :)

Ian Fellows

unread,
Nov 27, 2012, 2:42:56 AM11/27/12
to ded...@googlegroups.com
Little difficult to know exactly what should be present or missing
without knowing what version of Deducer/R you are using. as always,
providing output from sessionInfo() in your posts is a good idea. If
you are using R>=2.15.0 you can update to the latest Deducer with
update.packages(). The version in the all-in-one is not as up-to-date
as the version on CRAN.

Pie was indeed removed as ggplot2 had some rendering issues with it
and statisticians generally _hate_ pie charts. Note that a number of
new shiny templates were added, including dotplot and grouped dotplot.
There is also a new component "title" in the theme tab that makes
adding titles a bit more straight forward.

ian

Kieran Short

unread,
Nov 27, 2012, 6:19:05 PM11/27/12
to ded...@googlegroups.com
Thanks for your help Ian.
I was using the standard install from your website, so sessionInfo() gave 0.6-x (I forget the last number).
I did update,packages() but then I got lots of warnings about them being built for R 2.15.2, and I had 2.15.0.

The rest of this is for someone else's benefit, in case they want to do a manual install of Deducer on Windows7 and they're new at this like I am.

To go about getting fully updated to the latest version of R (to get rid of the warnings), because, for some reason I'm yet to understand, there is no update.R() function, I went about downloading R again from http://cran.r-project.org/ . I deleted all traces of R off my Windows7 box (uninstalling R is dirty, and leaves a lot of stuff behind in the Program Files), including all my user libraries, .JGREditorprefsrc, .JGRprefsrc, .RData in my user base directory. I then installed version of 2.15.2 (both 64 and 32 bit versions). I then gave complete Read Write Execute permissions for the R directory. 
Once R was installed I ran normal R, and did install.packages() and selected Deducer. After that, I did update.packages() to make sure everything was updated. Then I tried library(Deducer), but that failed because there was some weird path problem with --libpath when JGR was trying to start up (it said to copy some path and execution lines into Wordpad, and run it as a batch. However launching Deducer in R (libpath issue) and running the batch (can't find JGR launcher exe) fails. So that was a bit of a mess. 
However, I grabbed the JGR exe because in the output somewhere I saw:
So I downloaded that file, and copied it into:
C:\Program Files\R\R-2.15.2\bin

Running jgr-1_62.exe. from within that directory launched JGR, and from within JGR I went to the menu Packages & Data/Package Manager. In the package manager I located Deducer, and clicked "default" to launch it as a default on startup of JGR. To finish off, I made a shortcut to jgr-1_62.exe to my start menu, renamed the shortcut to Deducer. Now I think I have it running as it would come from your Windows Download & Install package.

The upshot of all this is, now I'm running the latest R, the latest Deducer, and as such - the pie chart is still gone (I understand that Statistician's hate it, but there are *thousands* of non-statistician scientists out there that have valid non-statistical representational uses for them; and are wandering into the R/Deducer world). However, for me, now I have the Title theme (which I didn't have before). Opts is still missing, but I don't think that matters so much.

Once again, thanks for your help Ian,

cheers,
Kieran

Kieran Short

unread,
Nov 27, 2012, 10:16:52 PM11/27/12
to ded...@googlegroups.com
One thing I've noticed now is that when I make a template, save, and then import it.. when I quit and restart JGR/Deducer, the template is gone from the 'Templates' tab and needs to be re-imported? I don't remember that being normal behaviour. I'm not sure if I might've set something up wrong?

regards,
Kieran

On Tuesday, November 27, 2012 6:42:57 PM UTC+11, Ian wrote:

Kieran Short

unread,
Nov 27, 2012, 11:18:40 PM11/27/12
to ded...@googlegroups.com
Oh my, I wish there was some sort of rewind so I could just pool these findings together.
Two things:
Firstly, a wee bug report: when using the Brewer template, "Pruples" is listed rather than "Purples", and produces a warning when using the Brewer colour dataset.

Secondly, is there a way to order data once it has been converted to a factor? I probably need to explain more though.. 
I've got a grouped bar plot, with a Y-variable which is length, an X-variable which is generations, and then am using Stage (a representation of age) as a Fill (which is being factored) - this turns it into a many-bar plot per single X tick (ticks are for Generation 1 to 11).
What is happening is that the order which the bars are being displayed (per tick) are not coming up as I would like them. The names are "Stage 7".. through to "Stage 12", and I would like it in that order. However, I get "Stage 10" to ".. 12" and then "Stage 7" to "... 9").
I can change the order of the Legend by using a discrete fill, and then re-listing the Stages, and that changes the legend labels, however the bar positions remain unchanged.


This is the console output of what I've got so far:

ggplot() + geom_bar(aes(y = Length..microns.,x = as.factor(Generation),fill = as.factor(Stage),group = Stage),data=Stage7to12.wt.group.summary.sheet.R,colour = '#000000',size = 0.2,alpha = 0.7899,fun.data = mean_sdl,mult = 1,stat = 'summary',position = position_dodge()) + scale_fill_brewer(guide = guide_legend(),breaks = c("Stage 7","Stage 8","Stage 9","Stage 10","Stage 11","Stage 12"),palette = 'Dark2') + theme_bw() + coord_cartesian(xlim = c(0,11),ylim = c(0,125))

Thanks for any potential help.

best regards,
Kieran

Ian Fellows

unread,
Nov 28, 2012, 1:14:47 AM11/28/12
to ded...@googlegroups.com
Hi Kieran,

1. Thanks for the bug report on the incorrect spelling of Purples. Now
fixed in the development version.
2. opt is no longer a part of ggplot2. it has been replaced by "theme"
in the theme tab.
3. The most straight forward way to change the order is to change the
order of the levels in the factor. In the data viewer, go to variable
view, and click on the factor levels of the variable of interest. Then
reorder the levels to the desired order.
4. Templates are not retained across R session, and have never been.
Perhaps something I will add in the future...

best,
ian

On Tue, Nov 27, 2012 at 8:18 PM, Kieran Short <kieran...@gmail.com> wrote:
> Purples

Kieran Short

unread,
Nov 28, 2012, 11:54:21 PM11/28/12
to ded...@googlegroups.com
Brilliant, thanks Ian.
The "Stages" were "as Factored" because they were automatically set as "Character" when I imported them from an XLSX spreadsheet. That is what what caught me out. Apon changing them to Factors in the Variable View, it was very easy to reorder them. I'm learning!

Perhaps another bug? 
When I Save a plot in Plot Builder which has some scale set (x discrete or continuous -- it doesn't matter), it always causes problems apon re-loading. The error I get is:
"Error in continuous_scale(c("x", "xmin", "xmax", "xend", "xintercept"),  : 
  formal argument "guide" matched by multiple actual arguments"

I've checked the R console input before and after a save, and the differences are:
before saving:
scale_x_continuous(breaks = c(1,2,3,4,5,6,7,8,9,10,11))

after saving and reloading:
scale_x_continuous(guide = guide_legend(),breaks = c(1,2,11,3,4,5,6,7,8,9,10))

So it's changing the number order slightly for some reason, and inserting "guide = guide_legend()"

If I remove "guide=guide_legend()" from scale_x_discrete then ggplot2 renders it just fine. Even though the break order has been changed during saving, it displays in the correct order (the reason I use it, is because it goes to 13, and I just want to display to 11). I'm happy that the order is right, but I'm not sure why it doesn't do 1, 2, 11, 3 .. ..  which is the order that is being sent to R).
I just confirmed, and with a discrete scale, "guide = guide_legend()" is also inserted upon saving.

best regards,
Kieran

Ian Fellows

unread,
Dec 1, 2012, 4:42:29 PM12/1/12
to ded...@googlegroups.com
Indeed, there was a stray attribute that was not getting saved with
the new ggplot2 guides. Fixed in the development version. Thanks for
the report.

ian
Reply all
Reply to author
Forward
0 new messages