Re: [Rd] SVN vs DVCS

2010-05-27 Thread Roger Peng
I think the main advantage of a DVCS is that it allows many many people to make changes to a project and to integrate those changes in a non-insane way. Given that R as a very restricted list of people who actually make changes to the source, it doesn't seem that something like git or Hg would prov

Re: [Rd] Sweave Feature Requests and Questions

2010-05-11 Thread Roger Peng
Hi, see below. On Sat, May 8, 2010 at 7:35 PM, Charlotte Maia wrote: > Furthermore, any help appreciated here: > 1. Does anyone know how to build Sweave documents, using Make, without > starting a new instance (or multiple instances) of R, every time Make > is called? This can be worked aroun

Re: [Rd] Generate NA of specified type

2010-05-05 Thread Roger Peng
What about NAof <- function(x) as(NA, class(x))? -roger On Wed, May 5, 2010 at 11:57 AM, Hadley Wickham wrote: > Hi all, > > Is there an existing function that provides the correct type of > missing value for a given vector? e.g. > > NAof(1:3) # NA_integer_ > NAof(pi) # NA_real_ > NAof("a") # NA

Re: [Rd] S4 Inheritance of environments

2010-04-24 Thread Roger Peng
I think using 'is(inEnv, "environment")' produces the answer you expect. Can't explain the other anomalies though. -roger On Sat, Apr 24, 2010 at 1:15 PM, Christopher Brown wrote: > I looked through the documentation and the mailing lists and could not > find an answer to this.  My apologies if

Re: [Rd] Associative array?

2010-03-15 Thread Roger Peng
If I recall correctly, I thought indexing a vector/list with a character vector uses hashing if the vector is over a certain length (I can't remember the cutoff). Otherwise, it's a linear operation. -roger On Thu, Mar 11, 2010 at 8:09 PM, Ben wrote: >> lists are generic vectors with names so loo

Re: [Rd] tcltk and R

2010-03-15 Thread Roger Peng
R can be built without tcl/tk and so I think it would still be good to check at runtime. -roger On Mon, Mar 15, 2010 at 11:21 AM, Gabor Grothendieck wrote: > I have had some comments on sqldf regarding its dependence on tcltk > such as the second last sentence on this blog post: > > http://trans

Re: [Rd] silly SVN question

2009-12-17 Thread Roger Peng
Are you searching for ./tools/rsync-recommended? -roger On Tue, Dec 15, 2009 at 11:14 AM, Ben Bolker wrote: > >  Yes, but ... on my system at least the Recommended folder has a recent > version of the Makefile, but the packages are old tarballs.  I have a > fuzzy memory that I needed to download

Re: [Rd] force & identity

2009-09-03 Thread Roger Peng
Given that the two functions (although identical) serve different purposes and are in a sense unrelated, it's not clear that a See Also is needed (and in fact might be confusing). -roger On Thu, Sep 3, 2009 at 9:17 AM, Hadley Wickham wrote: > Similarly, force & identity are identical (although wi

Re: [Rd] Speed up code, profiling, optimization, lapply vs. loops

2009-07-07 Thread Roger Peng
That's a good point---I've found that skipping a lot of the setup that 'glm' does and calling 'glm.fit' directly can save a lot of time. -roger On Tue, Jul 7, 2009 at 12:53 AM, Kasper Daniel Hansen wrote: > Aside from the advice from other people, you seem to be doing many glm > calls. A big part

Re: [Rd] Speed up code, profiling, optimization, lapply vs. loops

2009-07-06 Thread Roger Peng
My advice would be to use the profiler 'Rprof()' --- you may find that the loop is not really the problem. In my experience, there's relatively little difference between 'lapply' and a 'for' loop, although 'lapply' can be faster at times. -roger On Mon, Jul 6, 2009 at 4:26 AM, Thorn Thaler wrote:

Re: [Rd] what is the preferred method to create a package local variable?

2009-04-02 Thread Roger Peng
gestions. > > The package local environment (per Roger Peng) works well. > .localstuff <- new.env() > .localstuff$bbg.db.conn <- dbConnect(...) > > However, there is one thing that I'm confused about. > > Why must the .localstuff variable be an environment? > >

Re: [Rd] what is the preferred method to create a package local variable?

2009-03-31 Thread Roger Peng
I usually use environments for this. So, in one of the R files for the package, just do .localstuff <- new.env() Then, in functions you can do things like .localstuff$bbg.db.conn <- dbConnect(...) -roger On Tue, Mar 31, 2009 at 11:45 AM, Whit Armstrong wrote: > for the moment, I'm using: > >

Re: [Rd] Fontconfig warning with X11() on MAC OS X 10.4

2009-03-04 Thread Roger Peng
I realize this doesn't directly answer your question, but seeing as you're on a Mac, have you tried using the quartz device? -roger On Wed, Feb 25, 2009 at 10:27 AM, MerliseClyde wrote: > > I posted previously about problems with X11() on my MAC using R 2.8.1 . > After installing the securilty u

Re: [Rd] New version of X11, png and jpeg

2008-02-25 Thread Roger Peng
(Apologies, I meant to 'Reply to all' the first time but forgot). I built r44608 of R-devel with (I think) cairo support. At least, that's what the configure script told me. In addition, 'capabilities("cairo")' is TRUE. Calling X11(type = "Cairo") gives me the error: Error in X11() : X11 modu

Re: [Rd] Fwd: Digest package - make digest generic?

2007-10-16 Thread Roger Peng
;) digest.default <- function(object, ...) digest0(object, ...) As I think we've seen in this discussion already, what is surprising to one person may not be surprising to another (and vice versa) so having something like 'digest0' which is consistent across all R objects would b

Re: [Rd] Fwd: Digest package - make digest generic?

2007-10-16 Thread Roger Peng
return the same hash for 'a' and 'b' but I would personally find this behavior a little surprising. -roger On 10/16/07, Dirk Eddelbuettel <[EMAIL PROTECTED]> wrote: > > Hi Roger, > > On 16 October 2007 at 08:25, Roger Peng wrote: > | Sorry, I forgo

[Rd] Fwd: Digest package - make digest generic?

2007-10-16 Thread Roger Peng
Sorry, I forgot the 'reply-all'. -roger -- Forwarded message ------ From: Roger Peng <[EMAIL PROTECTED]> Date: Oct 16, 2007 8:24 AM Subject: Re: [Rd] Digest package - make digest generic? To: Henrik Bengtsson <[EMAIL PROTECTED]> Would it be possible to ins

[Rd] Lack of final newline in write.dcf changes append usage

2007-09-26 Thread Roger Peng
The change in r42731 eliminating the final blank line when writing DCF files changes the way 'append' can be used in 'write.dcf' and I was wondering if this is intentional. Basically, I want to write a data frame to DCF format one row at a time, so I make use of repeated calls to 'write.dcf(append

Re: [Rd] saving objects with embedded environments

2007-06-29 Thread Roger Peng
I believe this is intentional. See ?serialize. When lm() is called in a function, the environment is saved in case the resulting fitted model object needs to be updated, for example, with update(). if you don't want the linear model object, you might try just saving the relevant objects to a sep

Re: [Rd] HTML vignette browser

2007-06-05 Thread Roger Peng
This is very nice work and I like it a lot. I think it would be quite useful for teaching. My only thought was that when I saw 'source' I was expecting R code, but instead got LaTeX/Noweb. It does seem that 'source' is a little ambiguous here. -roger On 6/1/07, Deepayan Sarkar <[EMAIL PROTECT

Re: [Rd] Possible changes to connections

2007-05-30 Thread Roger Peng
In a previous version of the 'filehash' package, the 'filehashDB1' class had a slot for an open connection corresponding to the database file. I quickly learned that if the R object ever got removed or reassigned I was left hanging with an open file connection. If I remember correctly, I resorted

Re: [Rd] Display list redraw incomplete

2007-05-10 Thread Roger Peng
http://r.research.att.com/tools/ but I don't see how that would cause a problem here. Otherwise, I am using gcc 4.0.1 which comes with Xcode. I will keep digging but any pointers would be appreciated. Thanks, -roger On 5/4/07, Roger Peng <[EMAIL PROTECTED]> wrote: > Since compiling R

[Rd] Display list redraw incomplete

2007-05-04 Thread Roger Peng
Since compiling R 2.5.0 from source on my Mac (PowerBook) I've noticed some strange behavior when plotting. I'm not sure if it's a problem with my setup/compilation because I feel like a problem as basic as this one would have been reported already. I'm running R with X11 and R was built with gcc

Re: [Rd] directory/filename completion

2007-04-13 Thread Roger Peng
Okay, I wasn't sure if it was definitely related to rcompgen or was a result of something else. At least I can turn it off then. Thanks, -roger Prof Brian Ripley wrote: > On Fri, 13 Apr 2007, hadley wickham wrote: > >> On 4/13/07, Roger Peng <[EMAIL PROTECTED]> wro

[Rd] directory/filename completion

2007-04-13 Thread Roger Peng
I've noticed something recently in R-beta that has changed since R 2.4.1 and I'm not sure if it's a readline problem or an R problem. I am on a Linux FC5 system and in R 2.4.1 I could do load("my-directory/ and then hit TAB and it would list all of the files in 'my-directory', after which I c

[Rd] bug in Stangle(split=TRUE)

2007-04-07 Thread Roger Peng
[I originally emailed this to Friedrich Leisch but got no response and I just wanted to make sure it made it in before release.] While working with Stangle(), I noticed a problem when using 'split = TRUE'. Particularly, when there are two chunks where one chunk's name is a prefix of another c

Re: [Rd] [R] Aggregate?

2006-05-03 Thread Roger Peng
This was fixed fairly recently in 2.3.0 patched. It works in SVN revision 37953. -roger Gabor Grothendieck wrote: > I am moving this from r-help to r-devel. > > The poster pointed out to me that my solution works in 2.2.1 but not > in 2.3.0 patched. Does anyone know what the problem is? > >

Re: [Rd] Sweaving in png

2006-03-26 Thread Roger Peng
For what it's worth, I would find such a adaptation useful. -roger Thibaut Jombart wrote: > Hello list, > > despite I already posted a mail on this topic on R help, I guess this place > may be more appropriate. > I'll make it shorter this time. Sorry for posting twice. > > I found that using

Re: [Rd] a generic 'attach'?

2006-02-05 Thread Roger Peng
> I've noticed that David Brahm's package, g.data, for example really > has a method for attach as part of it, (well almost), but he has to > calls it g.data.attach. > > Another package that has an obvious application for a method for > attach is the filehash package of

Re: [Rd] Loading of namespace on load of .Rdata (was strange behaviour of load)

2006-01-21 Thread Roger Peng
[R-help removed] See below. Heather Turner wrote: > > 1. There is a more general situation where it would be useful to load > the namespace of a package after loading a saved workspace: when the > workspace contains objects of a class for which special methods are > required. E.g. if 'fm' from

[Rd] Building R-devel with ACML

2005-12-14 Thread Roger Peng
I'm trying to build R-devel with AMD's ACML. I downloaded version 3.0.0 64bit for gfortran (acml-3-0-0-gfortran-64bit.tgz) and copied the libraries to /usr/local/lib. When I configure R to build against the ACML library, how do I know if the library has been detected and will be used? I run

Re: [Rd] import of Namespaces

2005-12-01 Thread Roger Peng
My understanding is of your questions is below: Matthias Kohl wrote: > Dear R devels, > > let's say I have three packages "pkg1", "pkg2" and "pkg3" which all > contain new S4 classes and methods. Where "pkg3" depends on "pkg2" and > "pkg2" depends on "pkg1". Moreover, all three packages have na

Re: [Rd] write.csv ignores 'row.names'

2005-11-24 Thread Roger Peng
Okay, upon further examination, it appears that it works fine if you set 'row.names = FALSE' as opposed to 'row.names = F'. -roger Roger Peng wrote: > Upon replying to this email, I took a look at 'write.csv()' and noticed > something interesting. I rememb

[Rd] write.csv ignores 'row.names'

2005-11-24 Thread Roger Peng
Upon replying to this email, I took a look at 'write.csv()' and noticed something interesting. I remember there being a discussion sometime in the past about letting 'write.csv()' accept the 'row.names' argument. However, I get the following error: > write.csv(airquality, file = "myfile.csv",

Re: [Rd] write.csv

2005-11-24 Thread Roger Peng
If you don't want the row names, as 'write.csv()' writes out by default, try write.table(, file = "myfile.csv", sep = ",", row.names = FALSE) -roger Sven Schaltenbrand wrote: > hallo, > > i have a problem by writing a csv file > the first colum is filled with index numbers from 1 to n. > i ha

Re: [Rd] Packages that require other packages - How?

2005-11-09 Thread Roger Peng
If I'm not mistaken, when you put the other package in the "Depends:" field of DESCRIPTION, the other package will be loaded first, before your package is loaded. So you shouldn't have to put require/library anywhere else. -roger Gavin Simpson wrote: > Dear list, > > The help page for librar