>From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org]
On Behalf Of Gabor Grothendieck
>Sent: February-15-11 6:10 PM
>On Tue, Feb 15, 2011 at 5:43 PM, wrote:
>>
>> On 2/15/11 4:35 PM, "Gabor Grothendieck" wrote:
>>
>>>I think the real good programming practice is to have a s
> -Original Message-
> From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On
> Behalf Of Duncan Murdoch
> Sent: February-15-11 3:10 PM
> To: Kevin Wright
> Cc: R Devel List
> Subject: Re: [Rd] Request: Suggestions for "good teaching" packages, esp.
> with C code
>
On 15/02/2011 5:22 PM, Kevin Wright wrote:
For those of you "familiar with R", here's a little quiz. What what's the
difference between:
f1<- function(){
a=5
}
This returns 5, invisibly. It's also bad style, according to those of
us who prefer <- to = for assignment.
f2<- function(){
On Tue, Feb 15, 2011 at 5:43 PM, wrote:
>
> On 2/15/11 4:35 PM, "Gabor Grothendieck" wrote:
>
>>I think the real good programming practice is to have a single point
>>of exit at the bottom.
>
> I disagree, it can be extremely useful to exit early from a function. It
> can also make the code muc
On 16/02/2011 11:43 a.m., ken.willi...@thomsonreuters.com wrote:
On 2/15/11 4:35 PM, "Gabor Grothendieck" wrote:
I think the real good programming practice is to have a single point
of exit at the bottom.
I disagree, it can be extremely useful to exit early from a function. It
can also mak
On 2/15/11 4:35 PM, "Gabor Grothendieck" wrote:
>I think the real good programming practice is to have a single point
>of exit at the bottom.
I disagree, it can be extremely useful to exit early from a function. It
can also make the code much more clear by not having 95% of the body in a
huge
On Tue, Feb 15, 2011 at 4:48 PM, David Scott wrote:
> On 16/02/2011 7:04 a.m., Paul Johnson wrote:
>>
>> Hello,
>>
>> I am looking for CRAN packages that don't teach bad habits. Can I
>> have suggestions?
>>
>> I don't mean the recommended packages that come with R, I mean the
>> contributed ones
f3 <- function() {
( a <- 5 )
}
f4 <- function() {
a <- 5
a
}
On my machine f1,f2, and f4 all perform approx. the same. The () in
f3 adds about 20% overhead.
Jeff
On Tue, Feb 15, 2011 at 4:22 PM, Kevin Wright wrote:
> For those of you "familiar with R", here's a little quiz. What what'
PS: this is another glitch that arises when you don't use NAMESPACE
files. If the .requireCachedGenerics is in a NAMESPACE and not
exported, the conflict does not arise.
On 2/15/11 12:52 PM, John Chambers wrote:
No worries, and we will get rid of the warning message.
Certain of the S4 classe
f1 <- function(){
a=5
}
The primary difference is that function 1 uses an incorrect assignment
operator in an attempt to cause confusion ;)
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
For those of you "familiar with R", here's a little quiz. What what's the
difference between:
f1 <- function(){
a=5
}
f1()
f2 <- function(){
return(a=5)
}
f2()
Kevin Wright
On Tue, Feb 15, 2011 at 3:55 PM, Geoff Jentry wrote:
> On Wed, 16 Feb 2011, David Scott wrote:
>
>> 4. We don't
Joris,
I have added raster support only recently (last week ;)) and there was a bug
causing what you see. I have fixed it now so Cairo 1.4-7 will have the fix.
Thanks,
Simon
On Feb 15, 2011, at 9:48 AM, Joris Meys wrote:
> I was pointed to the Cairo package for plotting PNG images on a
> devi
On Wed, 16 Feb 2011, David Scott wrote:
4. We don't want gratuitous use of "return" at the end of functions.
Why do people still do that?
Well I for one (and Jeff as well it seems) think it is good programming
practice. It makes explicit what is being returned eliminating the
possibility of mis
On 16/02/2011 7:04 a.m., Paul Johnson wrote:
Hello,
I am looking for CRAN packages that don't teach bad habits. Can I
have suggestions?
I don't mean the recommended packages that come with R, I mean the
contributed ones. I've been sampling a lot of examples and am
surprised that many ignore s
No worries, and we will get rid of the warning message.
Certain of the S4 classes require methods for particular primitive
functions. If a subclass of one of those classes is loaded from a
package, then we need to turn on method dispatch for the corresponding
primitive(s). For efficiency, th
Hi Paul,
You might want to post this to the teaching list (R-sig-teaching). I'd
look at packages written by old-timers and R Core. I've also found that
most Bioconductor packages follow the guidelines you mention and many
other excellent habits very well. I agree with you that these are very
im
Hi,
Thanks for the clarification. Perhaps something along those lines
could be added to the help page.
Regards,
baptiste
On 15 February 2011 19:51, Paul Murrell wrote:
> Hi
>
> baptiste auguie wrote:
>>
>> Dear all,
>>
>> In an attempt to draw fill patterns in grid graphics, I have
>> encounte
On Tue, Feb 15, 2011 at 1:04 PM, Paul Johnson wrote:
> Hello,
>
> I am looking for CRAN packages that don't teach bad habits. Can I
> have suggestions?
>
> I don't mean the recommended packages that come with R, I mean the
> contributed ones. I've been sampling a lot of examples and am
> surpris
I think for teaching, you need to use R itself.
Everything else is going to be a derivative from that, and if you are
looking for 'correctness' or 'consistency' with the spirit of R, you
can only be disappointed - as everyone will take liberties or bring
personal style into the equation.
In addit
Hi
baptiste auguie wrote:
Dear all,
In an attempt to draw fill patterns in grid graphics, I have
encountered a behavior of grobX that I cannot understand from the
documentation. Consider this,
library(grid)
## gTree
g1 <- gTree(children=gList(
rectGrob(0.5,0.5, width=unit(0.8,"np
> A well-designed API generalized to work with arrays should probably
> borrow ideas from how argument 'MARGIN' of apply() works, how argument
> 'dim' in rowSums() for (though I must say the letter seem a bit ad hoc
> at first sight given the name of the function). There may also be
> something to
I think my recent packages are pretty good. In particular, I'd
recommend string, plyr and testthat as being well written, well
documented and (somewhat) well tested. I've also been trying to write
up the process of writing good packages. See
https://github.com/hadley/devtools/wiki for my thoughts
Hi.
On Sun, Feb 13, 2011 at 10:18 AM, TakeoKatsuki wrote:
>
> Hi Henrik,
>
> It would be nice if functions of the matrixStats package can handle array
> data.
> For example, rowSums() of the base package sums along the third axis of an
> array by rowSums(x, dim=2).
That is a good idea. This was
Hello,
I am looking for CRAN packages that don't teach bad habits. Can I
have suggestions?
I don't mean the recommended packages that come with R, I mean the
contributed ones. I've been sampling a lot of examples and am
surprised that many ignore seemingly agreed-upon principles of R
coding. In
Dear all,
If I load a package which creates reference classes whilst another
such package is also loaded, I get a warning about masking of the
".requireCachedGenerics" variable. (FWIW, both packages are
lazy-loaded.) Googling this variable name turned up only one previous
discussion, which didn't
On Sun, Feb 13, 2011 at 5:30 AM, Duncan Murdoch
wrote:
> On 11-02-12 4:57 PM, Henrik Bengtsson wrote:
>>
>> FYI, I'm sure the following is a temporary issue, but in case it slips
>> through, I want to raise it here. On Windows 7 64-bit, running Rcmd
>> check on R devel gives:
>
> I think you need
Please excuse the noise about dummy .Rnw.
On 02/15/2011 03:44 PM, Claudia Beleites wrote:
Also I started doing my homework with regards to package size, and that is
mainly cleaning leftovers from vignette generation and compressing the pdfs.
For most of my vignettes, ghostscript (lossy) compres
In my reminder that GSoC project proposals are requested (to R wiki developers'
projects
page for GSoC 2011), I mentioned that Dirk Eddelbuettel had acted as leader for
the R
Foundation activity on GSoC prior to handing the torch to Claudia Beleites and
I for this
year. I should have mentioned t
I was pointed to the Cairo package for plotting PNG images on a
device. I've been playing around with it, but found that after I use
the rasterImage function, I can't add anything any more to the device,
eg :
img <- readPNG(system.file("img", "Rlogo.png", package="png"))
r = as.raster(img[,,1:3])
Also I started doing my homework with regards to package size, and that is
mainly cleaning leftovers from vignette generation and compressing the pdfs.
For most of my vignettes, ghostscript (lossy) compression works very well:
I use the /screen settings and -dDownsampleColorImages=false
gs -sDEV
On 02/14/2011 11:54 PM, robin hankin wrote:
> Hello everybody
>
> [R-2.12.1]
>
> I am having difficulty dealing with Oarray objects.
> I have a generic function, call it foo(), and I wish
> to define a method for Oarray objects.
>
> I do not have or want a method for regular arrays [actually,
>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 02/15/2011 08:44 AM, Joris Meys wrote:
> Sorry, correction. X11() is not supposed to do that. So on Windows,
> per-pixel alpha is no option apparently. Any chance this will be
> implemented in the future?
>
> Cheers
> Joris
>
> PS : also thx to Si
ave reports a warning here:
> DF <- data.frame(A = c(1, 2, 2), B = c(1, 1, 2), C = c(1, 2, 3))
> with(DF, ave(C, A, B, FUN = min))
[1] 1 2 3
Warning message:
In FUN(X[[4L]], ...) : no non-missing arguments to min; returning Inf
In this case it can be avoided by using drop = TRUE which could only
Sorry, correction. X11() is not supposed to do that. So on Windows,
per-pixel alpha is no option apparently. Any chance this will be
implemented in the future?
Cheers
Joris
PS : also thx to Simon for his helpful answer earlier.
On Tue, Feb 15, 2011 at 2:40 PM, Joris Meys wrote:
> Thx again for
Thx again for your answer. I've tried X11() - which is supposed to
support alpha per pixel as well, but on Windows that's still no avail.
So basically, on Windows I can forget about alpha?
Cheers
Jors
On Tue, Feb 15, 2011 at 2:20 PM, Ben Bolker wrote:
> Joris Meys gmail.com> writes:
>
>>
>> I b
Joris Meys gmail.com> writes:
>
> I believed the standard plotting device on R in 2.12.1 would support
> per-pixel alpha. It does support alpha, as
>
> plot(1:2,type="l")
> polygon(c(1,1,2,2),c(1,2,2,1),col=rgb(60,100,60,60,maxColorValue=255))
>
> plots correctly. Which device should I use t
Hello everybody
[R-2.12.1]
I am having difficulty dealing with Oarray objects.
I have a generic function, call it foo(), and I wish
to define a method for Oarray objects.
I do not have or want a method for regular arrays [actually,
I want to coerce to an Oarray, and give a warning].
But setMet
The 2011 Google Summer of Code will soon be open for organizations to submit
potential
projects for which students may apply (with detailed plans) for funding. We
have some
proposals in process at
http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2011
Note that projects do need to h
On Sun, 13 Feb 2011, Yihui Xie wrote:
Regarding the reasons that make the doc directory large, I wonder if
we can make some changes in R:
'we' cannot: only core developers can. However, end users can
contribute in many other ways: see below.
1. Use a null graphics device as the default de
I believed the standard plotting device on R in 2.12.1 would support
per-pixel alpha. It does support alpha, as
plot(1:2,type="l")
polygon(c(1,1,2,2),c(1,2,2,1),col=rgb(60,100,60,60,maxColorValue=255))
plots correctly. Which device should I use then?
Cheers
Joris
On Mon, Feb 14, 2011 at 5:30
Dear all,
In an attempt to draw fill patterns in grid graphics, I have
encountered a behavior of grobX that I cannot understand from the
documentation. Consider this,
library(grid)
## gTree
g1 <- gTree(children=gList(
rectGrob(0.5,0.5, width=unit(0.8,"npc"),
he
41 matches
Mail list logo