[Rd] puzzle with drawDetails for a class derived from a gTree
Dear all, I've tried all sorts of variations discussed in "R graphics" by Paul Murrell, but I still can't understand how to write a drawDetails method for a class derived from a gTree. Below is a minimal, dummy example where two strings are plotted in two separate viewports. I require the creation of the strings to be evaluated inside the drawDetails function because my real example will need to calculate a grob size on-the-fly (the viewport size as well, for which I have no clue where to place the code). The tests below present two issues: - editing the gp component of the gTree only affects one child for some reason - the resulting gTree doesn't appear to contain children, they seem "hidden" from the user in the drawDetails method Any advice will be much appreciated! Best regards, Baptiste ## two function that create the text grobs make.test.right <- function(lab, col) { textGrob(lab, gp=gpar(col=col), name="right", vp="rightvp") } make.test.left <- function(lab, col) { textGrob(lab, gp=gpar(col=col), name="left", vp="leftvp") } grid.test <- function(right="right text", left="left text", col = "red", edits=NULL, draw=TRUE, name=NULL, gp=gpar()) { ## layout for the two children vp <- viewport(layout=grid.layout(1, 2)) ## viewports, one for each child cvp <- vpList(viewport(layout.pos.row=1, layout.pos.col=1, name="leftvp"), viewport(layout.pos.row=1, layout.pos.col=2, name="rightvp")) x <- gTree(right=right, left=left, col=col, childrenvp=cvp, edits=edits, name=name, gp=gp, vp=vp, cl="test") if(draw) grid.draw(x) invisible(x) } drawDetails.test <- function(x, recording=TRUE) { x <- applyEdits(x, x$edits) ## create the two grobs left <- make.test.left(x$left, x$col) right <- make.test.right(x$right, x$col) ## add them to the gTree x <- addGrob(x, right) x <- addGrob(x, left) ## borrowed from grid.xaxis ## draw the children only for(child in childNames(x)) grid.draw(getGrob(x, child)) } grid.test("a", "b", edits=gEdit(left="left text", col="blue"), name="test") # works as expected grid.newpage() grid.test(left="left text", right="right text", name="test") grid.edit("test",left="test") # OK grid.edit("test", col="blue") # OK grid.edit("test", right="big too?", gp=gpar(cex=2)) # here only the left grob is altered??? grid.edit("test::right", gp=gpar(cex=2)) ## fails ## as "test" doesn't have children, apparently # similarly grid.gedit("right", right="testing") # 'gPath' (right) not found sessionInfo() R version 2.9.2 (2009-08-24) i386-apple-darwin8.11.1 locale: en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets grid methods [8] base __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] mboost_1.1-3 blackboost_fit (PR#13972)
Please read the FAQs about submitting bug reports. Bugs in contributed packages must not go to the R-bugs repository but to the corresponding package maintainer, CCing in this case (I do not confirmed that it is a bug). Best, Uwe Ligges bulls...@mail.ru wrote: Full_Name: Ivan the Terrible Version: 2.9.2 OS: Windows XP SP3 Submission from: (NULL) (89.110.13.151) When using the method blackboost_fit of the package mboost appear following error : Error in party:::get_variables(o...@responses) : trying to get slot "responses" from an object (class "boost_data") that is not an S4 object Simple test case that produce bug: dt=expand.grid(y=c(2,3,4), x1=c(1,2), x2=c(1,2)) library(mboost) bd=boost_dpp(y ~ .,data=dt, weights = NULL) blackboost_fit(bd, tree_controls = ctree_control( teststat = "max", testtype = "Teststatistic", mincriterion = 0, maxdepth = 2 ), fitmem = ctree_memory( bd, TRUE ), family = GaussReg(), control = boost_control( mstop = 2 ), weights = NULL ) Test case session on my computer: dt=expand.grid(y=c(2,3,4), x1=c(1,2), x2=c(1,2)) library(mboost) Loading required package: modeltools Loading required package: stats4 Loading required package: party Loading required package: survival Loading required package: splines Loading required package: grid Loading required package: coin Loading required package: mvtnorm Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric Loading required package: sandwich Loading required package: strucchange Loading required package: vcd Loading required package: MASS Loading required package: colorspace bd=boost_dpp(y ~ .,data=dt, weights = NULL) blackboost_fit(bd, +tree_controls = ctree_control( + teststat = "max", + testtype = "Teststatistic", + mincriterion = 0, + maxdepth = 2 + ), +fitmem = ctree_memory( + bd, + TRUE + ), +family = GaussReg(), +control = boost_control( +mstop = 2 + ), +weights = NULL + ) Error in party:::get_variables(o...@responses) : trying to get slot "responses" from an object (class "boost_data") that is not an S4 object sessionInfo() R version 2.9.2 (2009-08-24) i386-pc-mingw32 locale: LC_COLLATE=Russian_Russia.1251;LC_CTYPE=Russian_Russia.1251;LC_MONETARY=Russian_Russia.1251;LC_NUMERIC=C;LC_TIME=Russian_Russia.1251 attached base packages: [1] grid splines stats graphics grDevices utils datasets methods base other attached packages: [1] mboost_1.1-3 party_0.9-999 vcd_1.2-4 colorspace_1.0-1 MASS_7.2-48 strucchange_1.3-7 [7] sandwich_2.2-1zoo_1.5-8 coin_1.0-6mvtnorm_0.9-7 survival_2.35-4 modeltools_0.2-16 loaded via a namespace (and not attached): [1] lattice_0.17-25 stats4_2.9.2 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] xaxs disactivated when asp=1 in plots (PR#13971)
Not a bug, see ?plot.window that tells us: asp: If asp is a finite positive value then the window is set up so that one data unit in the x direction is equal in length to asp * one data unit in the y direction. Note that in this case, par("usr") is no longer determined by, e.g., par("xaxs"), but rather by asp and the device's aspect ratio. (See what happens if you interactively resize the plot device after running the example below!) Best, Uwe Ligges francois_birg...@ncsu.edu wrote: Full_Name: François Birgand Version: 2.9.0 OS: windows xp Submission from: (NULL) (152.1.16.161) When I type this sequence: x11() Ylim<-c(0,14) Xlim<-c(0,14) plot(0,0,xlim=Xlim,ylim=Ylim,col="white",main="",xlab="",ylab="",bty="n",xaxt="n",yaxt="n",xaxs="i",yaxs="i",asp=1) abline(h=c(0,14),lwd=2,col="grey") abline(v=c(0,14),lwd=2,col="grey") par(new=TRUE) abline(h=seq(0,14,by=0.2),lty=3,col="grey") abline(h=seq(0,14,by=1),lty=1,col="grey") abline(v=seq(0,14,by=0.2),lty=3,col="grey") abline(v=seq(0,14,by=1),lty=1,col="grey") par(new=TRUE) only yaxs="i" is taken into account while xaxs="i" is ignored. When I remove asp=1, xaxs="i" is activated again. Small bug but kind of bothersome...!! Congratulations for the great work you guys are doing! François __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] build time dependency
Romain Francois wrote: Hello, Is there such thing as a build time dependency between packages : package B needs package A so that it can build, but once built it lives without it. Do you mean at a) "R CMD build" time or at b) "R CMD INSTALL" time? For a), you probably do not need to declare it in DESCRIPTION at all (untested). For b), you need to declare it. I feel uncomfortable to change the Depends field between source and binary version of a package. At least, it is not documented to work and if it works (have you tested that?), it might not work in some future release of R. But since you gave at least 2 reasonable examples for a INSTALL-time-only dependency, you might want to contribute some patches to handle such a thing. Best wishes, Uwe For example depending on the ant package to compile java code, or depend on roxygen to roxygenize the code, ... Adding roxygen to Depends works, but then the installed package does not depend on it and therefore loads it for nothing. Maybe I can remove roxygen from the Depends as part of the ./configure[.win] ... Romain __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Windows Laptop specification query
I've read some postings back in 2002/2006 about running R on multiple core CPUs. The answer was basically separate processes work fine, but parallelization needs to be implemented using snow/rmpi. Are the answers still the same? I ask because we are about to order a laptop running Windows for a new staff member. Some advice on the following would be helpful. It will be ordered with Vista, with a free upgrade to Windows 7. It will have 8GB of memory A quad core CPU costs about AUD$1100 more than the fastest (Intel T9900-6M Cache, 3.06 GHz) dual core CPU. I'm wondering if there is value in ordering the quad core. We are looking at a time frame of 3-4 years. Is anyone aware of near future plans to implement some form or parallelization that would more or less be hidden from the normal user? It is anticipated that analysis of Next Gen sequence data will be important. I've read the Windows FAQ about running R under Vista. We will probably start with Vista. I've read some posts in R-devel indicating people are running R under Windows 7. Is it safe to assume that R will run under Windows 7 after it is released? We are hoping to make use the 8GB of memory. Am I right in assuming that when the 64 bit version of Windows 7 is available, it will allow R users to make good use of the 8GB of memory. Does this happen under the current higher end versions of 64 bit Vista? cheers, Keith Keith Satterley Bioinformatics Division The Walter and Eliza Hall Institute of Medical Research Parkville, Melbourne, Victoria, Australia __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Windows Laptop specification query
Good morning Keith, Have a look at http://cran.r-project.org/bin/windows/base/rw-FAQ.html#There-seems-to-be-a-limit-on-the-memory-it-uses_0021 The short answer is that "it depends"... a) memory is limited under windows b) R is essentially a serial program - HOWEVER it depends what you're actually doing - if you're working with large matrices then there are parallel versions of BLAS that can be used... On a multi-core windows machine with lots of memory you can of course run up multiple copies of R and run each independently Kind regards, Sean On Mon, Sep 28, 2009 at 4:40 AM, Keith Satterley wrote: > I've read some postings back in 2002/2006 about running R on multiple core > CPUs. The answer was basically separate processes work fine, but > parallelization needs to be implemented using snow/rmpi. Are the answers > still the same? > > I ask because we are about to order a laptop running Windows for a new > staff member. Some advice on the following would be helpful. > It will be ordered with Vista, with a free upgrade to Windows 7. It will > have 8GB of memory > > A quad core CPU costs about AUD$1100 more than the fastest (Intel T9900-6M > Cache, 3.06 GHz) dual core CPU. > I'm wondering if there is value in ordering the quad core. We are looking > at a time frame of 3-4 years. > > Is anyone aware of near future plans to implement some form or > parallelization that would more or less be hidden from the normal user? > > It is anticipated that analysis of Next Gen sequence data will be > important. > > I've read the Windows FAQ about running R under Vista. We will probably > start with Vista. I've read some posts in R-devel indicating people are > running R under Windows 7. Is it safe to assume that R will run under > Windows 7 after it is released? > > We are hoping to make use the 8GB of memory. Am I right in assuming that > when the 64 bit version of Windows 7 is available, it will allow R users to > make good use of the 8GB of memory. Does this happen under the current > higher end versions of 64 bit Vista? > > cheers, > > Keith > > > Keith Satterley > Bioinformatics Division > The Walter and Eliza Hall Institute of Medical Research > Parkville, Melbourne, > Victoria, Australia > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] documentation cross references under R 2.10.0dev for Windows
Rcmd check under R 2.10.0dev for Windows seems to be issuing a number of spurious warning messages about Rd cross-references. The following warning messages appear when checking the latest (non-public) version of the Bioconductor package limma. They appear only under Windows, not Unix or Mac. All the flagged links appear to be ok, in that they specific a genuine html file, and should therefore not be marked as suspect or missing. Regards Gordon * using R version 2.10.0 Under development (unstable) (2009-09-27 r49846) * using session charset: ISO8859-1 * checking Rd cross-references ... WARNING Missing link(s) in documentation object './man/01Introduction.Rd': '[limma:00Index]{LIMMA contents page}' Suspect link(s) in documentation object './man/asmalist.Rd': '[marray:marrayNorm-class]{marrayNorm}' Suspect link(s) in documentation object './man/asmatrix.Rd': '[Biobase]{exprs}' Suspect link(s) in documentation object './man/dupcor.Rd': '[statmod]{mixedModel2Fit}' Suspect link(s) in documentation object './man/EList.Rd': '[Biobase]{ExpressionSet-class}' Suspect link(s) in documentation object './man/imageplot.Rd': '[marray]{maImage}' Suspect link(s) in documentation object './man/intraspotCorrelation.Rd': '[statmod]{remlscore}' Suspect link(s) in documentation object './man/limmaUsersGuide.Rd': '[Biobase]{openPDF}' '[Biobase]{openVignette}' '[base]{Sys.putenv}' Suspect link(s) in documentation object './man/malist.Rd': '[marray:marrayNorm-class]{marrayNorm}' Suspect link(s) in documentation object './man/normalizebetweenarrays.Rd': '[marray:maNormScale]{maNormScale}' '[affy:normalize]{normalize}' Suspect link(s) in documentation object './man/normalizeWithinArrays.Rd': '[marray:maNorm]{maNorm}' Suspect link(s) in documentation object './man/normexpfit.Rd': '[affy:bg.adjust]{bg.parameters}' Suspect link(s) in documentation object './man/readgal.Rd': '[marray:read.Galfile]{read.Galfile}' Suspect link(s) in documentation object './man/rglist.Rd': '[marray:marrayRaw-class]{marrayRaw}' On Wed, 23 Sep 2009, Duncan Murdoch wrote: On 23/09/2009 10:08 PM, Henrik Bengtsson wrote: Hi, in 'Writing R Extensions" of R v2.10.0, under Section 'Cross-references' (2009-09-07) it says: 1. "The markup \link{foo} (usually in the combination \code{\link{foo}}) produces a hyperlink to the help for foo. Here foo is a topic, that is the argument of \alias markup in another Rd file (possibly in another package)." 2. "You can specify a link to a different topic than its name by \link[=dest]{name} which links to topic dest with name name. This can be used to refer to the documentation for S3/4 classes, for example \code{"\link[=abc-class]{abc}"} would be a way to refer to the documentation of an S4 class "abc" defined in your package, and \code{"\link[=terms.object]{terms}"} to the S3 "terms" class (in package stats). To make these easy to read, \code{"\linkS4class{abc}"} expands to the form given above." 3. "There are two other forms of optional argument specified as \link[pkg]{foo} and \link[pkg:bar]{foo} to link to the package pkg, to files foo.html and bar.html respectively. These are rarely needed, perhaps to refer to not-yet-installed packages (but there the HTML help system will resolve the link at run time) or in the normally undesirable event that more than one package offers help on a topic20 (in which case the present package has precedence so this is only needed to refer to other packages). They are only in used in HTML help (and ignored for hyperlinks in LaTeX conversions of help pages), and link to the file rather than the topic (since there is no way to know which topics are in which files in an uninstalled package). The *only* reason to use these forms for base and recommended packages is to force a reference to a package that might be further down the search path. Because they have been frequently misused, as from R 2.10.0 the HTML help system will look for topic foo in package pkg if it does not find file foo.html." Trying to summarize the above, do we have the following markups/rules? A. \link{} - where must occur as an \alias{}, but not necessarily as an \name{}. The link will be display as the string . B. \link[=]{} - where must occur as an \alias{} with a \name{}. The link will be display as the string . C. \link{]{} - where must be a \name{} in a package named . The link will be display as the string . D. \link{:]{} - where must be a \name{} in a package named . The link will be display as the string . There are no restrictions on . E. \linkS4class{} expands to \link[=-class]{}. From (B) it then follows that there must be an \alias{-class} and a \name{}. Q1. Is that correct? To me it look a bit inconsistent. No, \name{} is irrelevant for links. It's the filename that matters in the 3rd form. Q2. Are there more? Q3. Will there be more? Q4. What about \link[=]{} \link{:]{} where can be (almost) any string? The first is what