Re: [Rd] rowSums()/colSums() don't preserve the 'integer' storage mode

2008-07-17 Thread Henrik Bengtsson
I had a look at the source code and the coercion to double is only done one the sum of each row/column, so the "overhead" (e.g. memory) is only on the summed result. The integer matrix is *not*coerced to double before summing, which could be case if done before calling the native code. The latter

Re: [Rd] rowSums()/colSums() don't preserve the 'integer' storage mode

2008-07-17 Thread Henrik Bengtsson
Hi, there is one more thing to consider: the risk of getting integer overflow. Should that be ignored? How is this handled by sum()? I think it is good if {col|row}Sums() would return the same data type as the input object. Cheers Henrik On Thu, Jul 17, 2008 at 6:32 PM, Herve Pages <[EMAIL P

[Rd] Clash between 'Cairo' and 'EBImage' packages on Windows

2008-07-19 Thread Henrik Bengtsson
Hi, on Windows XP Pro with R version 2.7.1 Patched (2008-06-27 r46012) the 'Cairo' and the 'EBImage' packages does not play well together. Loading EBImage before Cairo cause the following to happen: # Rterm --vanilla > library(EBImage); > library(Cairo) Error in inDL(x, as.logical(local), as.log

[Rd] R CMD check test examples with and without Suggest installed

2008-07-20 Thread Henrik Bengtsson
Hi, is there a way to have R CMD check test the example():s twice, once with all Suggest package hidden or once, if $R_check_force_suggests=1, with all Suggest available? BACKGROUND: I just had a case where my R.matlab package passed all R CMD checks on my local machine, but when I uploaded it to

[Rd] serialize() to via temporary file is heaps faster than doing it directly (on Windows)

2008-07-24 Thread Henrik Bengtsson
Hi, FYI, I just notice that on Windows (but not Linux) it is orders of magnitude (below it's 50x) faster to serialize() and object to a temporary file and then read it back, than to serialize to an object directly. This has for instance impact on how fast digest::digest() can provide a checksum.

Re: [Rd] C versions of serialize/unserialize in packages

2008-07-31 Thread Henrik Bengtsson
Hi, On Thu, Jul 31, 2008 at 6:35 AM, Roger D. Peng <[EMAIL PROTECTED]> wrote: > Are the functions 'R_Unserialize' and 'R_InitFileInPStream' allowed to > be used in R packages? I guess I'm just not clear on the implications > of this comment in 'Rinternals.h': > > /* The connection interface is no

Re: [Rd] Suggestion: 20% speed up of which() with two-character mod

2008-08-04 Thread Henrik Bengtsson
one report diff:s, do you prefer to get it with or without context information, e.g. -C 3? /Henrik On Fri, Jul 11, 2008 at 8:57 AM, Charles C. Berry <[EMAIL PROTECTED]> wrote: > On Thu, 10 Jul 2008, Henrik Bengtsson wrote: > >> Hi, >> >> by replacing 'll' w

Re: [Rd] Suggestion: 20% speed up of which() with two-character mod

2008-08-05 Thread Henrik Bengtsson
Hi, thanks for this. I'll use "unified" diff next time, i.e. diff -u .R .R /Henrik On Tue, Aug 5, 2008 at 5:54 AM, Martin Maechler <[EMAIL PROTECTED]> wrote: >>>>>> "HenrikB" == Henrik Bengtsson <[EMAIL PROTECTED]> >>>>

Re: [Rd] Constructor blah() vs. as.blah()

2008-08-15 Thread Henrik Bengtsson
This thread is going to be a lot about matter of tastes, but at least I would think of blah() as a constructor function and as.blah() as a coerce function. There should always be one constructor function, but providing coerce functions is optional. Furthermore, the constructor function should be

Re: [Rd] save() should not overwrite a file if an error occurs (PR#12583)

2008-08-22 Thread Henrik Bengtsson
I don't know what save() "should" do - your use case is quite special - but I agree it would be better if save() tests for the existence of all object(s) to be saved before opening the connection (and thereby overwrite the existing file). A workaround for you is to do: dummy <- a; save(a, file="a

[Rd] Can the file locking in filehash be reused? (Was: Re: [R] [R-pkgs] filehash 2.0)

2008-08-28 Thread Henrik Bengtsson
Hi (Roger), I saw the announcement of filehash v2.0 and the sentence "This development has lead to better file locking for concurrent access and faster reading and writing of data in general" caught my attention. What kind of file locking do you refer to here? I am looking for a mechanism that ca

Re: [Rd] serialize() to via temporary file is heaps faster than doing it directly (on Windows)

2008-08-29 Thread Henrik Bengtsson
I just want to re-post this thread in case it slipped through the "summer sieve" of someone that might be interested and/or has a real solution beyond my serialize2() patch. Cheers Henrik On Thu, Jul 24, 2008 at 8:10 PM, Henrik Bengtsson <[EMAIL PROTECTED]> wrote: > Hi, >

Re: [Rd] Bug in base::mean.default ? (PR#12984)

2008-09-23 Thread Henrik Bengtsson
Not a bug. There is a statement in base::mean.default() before this if (na.rm) x <- x[!is.na(x)] that removes any missing values. Thus, it is known that there are no missing values beyond this statement. /Henrik On Tue, Sep 23, 2008 at 8:25 AM, <[EMAIL PROTECTED]> wrote: > In the

Re: [Rd] splitting strings efficiently

2008-09-24 Thread Henrik Bengtsson
For strsplit(), note that fixed=TRUE is much faster. /HB On Wed, Sep 24, 2008 at 9:20 AM, Mark Kimpel <[EMAIL PROTECTED]> wrote: > I knew there HAD to be a basic function, but 'help.search("split string")' > and 'help("string") did not find it. Thanks for the help on this elementary > question. >

[Rd] as.list() for function:s

2008-10-16 Thread Henrik Bengtsson
Hi, a quick comment. I just notice that as.list() deals with function:s the old way inside the "default" function, cf. > as.list.default function (x, ...) { if (typeof(x) == "list") return(x) if (is.function(x)) return(c(formals(x), list(body(x .Internal(as.vector(

[Rd] file.access() on network (mounted) drive on Windows Vista?

2008-11-26 Thread Henrik Bengtsson
Hi, I have a writable and readable file on a small network file system (Cisco NSLU2 Unslung; non-NTFS) that I access via a mounted drive on Windows Vista. My problem could be due to a "funny" file system/server, but here it goes: > pathname <- "Q:/foo.txt" > cat(file=pathname, "Hello world!\n")

Re: [Rd] file.access() on network (mounted) drive on Windows Vista?

2008-12-01 Thread Henrik Bengtsson
error have happened both ways. > > (I think any OS with multiple filesystems potentially has problems like > this: we saw them with Unix (Solaris) file systems mounted on MacOS X via > Samba, even when the same thing works correctly on Linux.) > > On Wed, 26 Nov 2008, Henrik Bengts

Re: [Rd] package development

2008-12-12 Thread Henrik Bengtsson
Using parse() is better for syntax errors; pathnames <- list.files(path="pkg/R", pattern="[.](r|R|s|S)$", full.names=TRUE); for (pathname in pathnames) parse(pathname) /Henrik On Thu, Dec 11, 2008 at 4:00 PM, Duncan Murdoch wrote: > On 11/12/2008 6:04 PM, Terry Therneau wrote: >> >> I'm making

[Rd] x <- 1:2; dim(x) <- 2? A vector or not?

2009-01-12 Thread Henrik Bengtsson
Ran into the follow intermediate case in an external package (w/ recent R v2.8.1 patched and R v2.9.0 devel): > x <- 1:2 > dim(x) <- 2 > dim(x) [1] 2 > x [1] 1 2 > str(x) int [, 1:2] 1 2 > nrow(x) [1] 2 > ncol(x) [1] NA > is.vector(x) [1] FALSE > is.matrix(x) [1] FALSE > is.array(x) [1] TRUE > x[

Re: [Rd] x <- 1:2; dim(x) <- 2? A vector or not?

2009-01-13 Thread Henrik Bengtsson
ve enough internal glue in place that an end user > would not notice the difference (but those working at C level with R objects > may need to know). > > On Mon, 12 Jan 2009, Henrik Bengtsson wrote: > >> Ran into the follow intermediate case in an external package (w/ >> rec

Re: [Rd] Windows installer text bug (PR#13445)

2009-01-14 Thread Henrik Bengtsson
On Tue, Jan 13, 2009 at 4:30 PM, wrote: Hey, this guy builds engines for aircraft *and* uses freeware! I was on such a jet just few days ago and I can confirm that I did not notice anything strange (except the food). > Full_Name: Rob Cranfill > Version: 2.8.1 > OS: Windows XP SP2 > Submission

Re: [Rd] More intensive checking of R help files

2009-01-15 Thread Henrik Bengtsson
Hi, this sounds all good. One comment below: On Fri, Jan 9, 2009 at 1:25 AM, Prof Brian Ripley wrote: > > We have been working on handling Rd (R help) files with R rather than Perl > scripts. As part of that work, Duncan has written a parser which has > revealed many problems in package help f

[Rd] Package impute exist in quite different version on CRAN and BioC

2009-01-23 Thread Henrik Bengtsson
[CC:ing package maintainer of 'impute' package and crossposting to r-devel and bioc-devel because this affects both audiences] Hi, the 'impute' package is published both on CRAN and Bioconductor; http://cran.r-project.org/web/packages/impute/ http://bioconductor.org/packages/2.3/bioc/html/impu

[Rd] Flag '#' in sprintf() gives an error in R v2.9.0 devel

2009-02-02 Thread Henrik Bengtsson
Hi, in R v2.8.1 patched (2008-12-22 r47296) the following works: > sprintf("%#x", 1) [1] "0x1" whereas in R v2.9.0 devel (2009-01-08 r47515) it gives: > sprintf("%#x", 1); Error in sprintf("%#x", 1) : use format %f, %e, %g or %a for numeric objects Not sure if this was an intended move or no

[Rd] R CMD build: "Subdirectory 'R' contains invalid file names"

2006-02-10 Thread Henrik Bengtsson
Hi, I get * excluding invalid files from 'R.oo' Subdirectory 'R' contains invalid file names: attachLocally.Object.Rex Exception.Rex extend.default.Rex InternalErrorException.reportBug.Rex Package.Rex Person.Rex Rdoc.Rex setMethodS3.Rex StaticFields.Rex when running R CMD build in R v2.3.0

Re: [Rd] R CMD build: "Subdirectory 'R' contains invalid file names"

2006-02-10 Thread Henrik Bengtsson
Hi, On 2/10/06, Kurt Hornik <[EMAIL PROTECTED]> wrote: > >>>>> Henrik Bengtsson writes: > > > Hi, I get > > * excluding invalid files from 'R.oo' > > Subdirectory 'R' contains invalid file names

[Rd] MinGW and the ld bug

2006-02-13 Thread Henrik Bengtsson
Hi. I noticed that Brian Ripley found and corrected a bug in MinGW's ld.exe, see http://www.murdoch-sutherland.com/Rtools/. Thanks for this. I wonder if this is the same bug that cause my problems. I have tiny toy package with C code that installs perfectly on R Version 2.2.1 beta (2005-12-18 r

Re: [Rd] MinGW and the ld bug

2006-02-14 Thread Henrik Bengtsson
t; %.dll: > @$(ECHO) LIBRARY $*.dll > $*.def Thanks. With "@$(ECHO) LIBRARY $ > $*.def" it works again. All the best, Henrik > but that is not a general solution. > > > On Mon, 13 Feb 2006, Henrik Bengtsson wrote: > > > Hi. > > > > I

[Rd] file.info() on WinXP/NTFS > 2Gb

2006-02-18 Thread Henrik Bengtsson
Hi, on WinXP Pro SP2 with NTFS, I noticed that file.info() under Rv2.2.1pat (2006-02-09) does not report the correct file size if the file is >= 2^31 bytes (2GB). Is this problem known? Is this related to the note in ?file.info: "Some (broken) systems allow files of more than 2Gb to be created

Re: [Rd] file.info() on WinXP/NTFS > 2Gb

2006-02-18 Thread Henrik Bengtsson
On 2/18/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Sat, 18 Feb 2006, Henrik Bengtsson wrote: > > > Hi, > > > > on WinXP Pro SP2 with NTFS, I noticed that file.info() under > > Rv2.2.1pat (2006-02-09) does not report the correct file size if the > &

Re: [Rd] Wishlist - Give R a name that shows up in search engines ...

2006-03-08 Thread Henrik Bengtsson
> > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > > > > > > > __ > > 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 > > -- Henrik Bengtsson Mobile: +46 708 909208 (+1h UTC) __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] Can example() code stop the example without generating an error?

2006-03-14 Thread Henrik Bengtsson
Hi, does anyone know if it is possible to write example code (in Rd examples) such that one can stop the example without generating an error? Example: code A if (cond) niceStop() code B I know this sounds weird, but I would like some of my Rd examples to run if and only if another package is

[Rd] New simpleExit() condition (Was: Re: Can example() code stop the example without generating an error?)

2006-03-14 Thread Henrik Bengtsson
On 3/14/06, Uwe Ligges <[EMAIL PROTECTED]> wrote: > Henrik Bengtsson wrote: > > > Hi, > > > > does anyone know if it is possible to write example code (in Rd > > examples) such that one can stop the example without generating an > > error? Example: &

Re: [Rd] New simpleExit() condition (Was: Re: Can example() code stop the example without generating an error?)

2006-03-16 Thread Henrik Bengtsson
On 3/14/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > I would very much like to see such a feature too. > > On 3/14/06, Henrik Bengtsson <[EMAIL PROTECTED]> wrote: [snip] > > A nicer and more general solution is to have a subclass "simpleExit" >

[Rd] Safe to UNPROTECT() when object is assigned to a list?

2006-03-27 Thread Henrik Bengtsson
Hi, I'm troubleshooting some native code on Windows that very occationally (and semi-randomly) crashes R. Already looked at "everything", I just want to double check that it is safe to UNPROTECT() allocated variables as soon as they are assigned to, say, a PROTECTed list. >From (R v2.3.0) Sectio

[Rd] How to set options() when a package without a name space is loaded?

2006-03-28 Thread Henrik Bengtsson
Hi, how do I set options() when loading a package *without* a name space? Is it possible? I though this one was a common question, but I could not find it in the FAQ, in the help nor in the r-help/r-devel archives. Section 1.6.3 on "Load hooks" in "Writing R Extensions" says that this should be

Re: [Rd] How to set options() when a package without a name space is loaded?

2006-03-28 Thread Henrik Bengtsson
call those functions with side effects". The reason why it "didn't work" was that I mispelled the option in .First.lib(). It's time for me to go home now ;) Henrik On 3/28/06, Henrik Bengtsson <[EMAIL PROTECTED]> wrote: > Hi, > > how do I set options()

[Rd] Substitute() changed since R2.3.0 (2006-02-02 r37243)?

2006-03-29 Thread Henrik Bengtsson
Hi, I've got the following two versions of R on WinXP: A) R Version 2.3.0 Under development (unstable) (2006-02-02 r37243) B) R Version 2.3.0 Under development (unstable) (2006-03-27 r37579) and a the following "test.R" script: foo <- function(path, ...) { print(path) } bar <- function(x, ...)

Re: [Rd] Substitute() changed since R2.3.0 (2006-02-02 r37243)?

2006-03-29 Thread Henrik Bengtsson
On 29 Mar 2006 11:58:34 +0200, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > "Henrik Bengtsson" <[EMAIL PROTECTED]> writes: > > > Hi, > > > > I've got the following two versions of R on WinXP: > > > > A) R Version 2.3.0 Under developm

Re: [Rd] package?

2006-04-01 Thread Henrik Bengtsson
Reproducible example? To the best of my knowledge does 'type?topic' just bring up a help page; nothing is generated dynamically here. Example package?base. Are you thinking about how "package" Rd help pages are generated with promptPackage()? /Henrik On 3/31/06, Paul Gilbert <[EMAIL PROTECTED]

Re: [Rd] Substitute() changed since R2.3.0 (2006-02-02 r37243)?

2006-04-03 Thread Henrik Bengtsson
Follow up: I've downloaded todays R v2.3.0 alpha (2006-04-02 r37626) for Windows and the below bug has been fixed: > yaa <- function(...) substitute(list(...)) > yaa(foo(x,y,...,z)) list(foo(x, y, ..., z)) Thank you (Duncan!?) Henrik On 3/29/06, Henrik Bengtsson <[EMAIL

[Rd] Example of environment

2006-04-04 Thread Henrik Bengtsson
A minor comment: in help(environment) the example starts with: ##-- all three give the same: environment() environment(environment) .GlobalEnv but the comment is not true. The second returns the "". "R : Copyright 2006, The R Foundation for Statistical Computing Version 2.3.0 alph

[Rd] Return function from function with minimal environment

2006-04-04 Thread Henrik Bengtsson
Hi, this relates to the question "How to set a former environment?" asked yesterday. What is the best way to to return a function with a minimal environment from a function? Here is a dummy example: foo <- function(huge) { scale <- mean(huge) function(x) { scale * x } } fcn <- foo(1:10e5)

Re: [Rd] Return function from function with minimal environment

2006-04-04 Thread Henrik Bengtsson
On 4/4/06, Thomas Lumley <[EMAIL PROTECTED]> wrote: > On Tue, 4 Apr 2006, Henrik Bengtsson wrote: > > > Hi, > > > > this relates to the question "How to set a former environment?" asked > > yesterday. What is the best way to to return a function

Re: [Rd] Return function from function with minimal environment

2006-04-04 Thread Henrik Bengtsson
To the best of my understanding right now, it is better to use "::" as below: foo <- function(huge) { mu <- mean(huge) env <- new.env(parent=baseenv()) assign("mu", mu, envir=env) bar <- function(n) { stats::rnorm(n, mean=mu) } environment(bar) <- env

Re: [Rd] Return function from function with minimal environment

2006-04-04 Thread Henrik Bengtsson
On 4/4/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > On 4/4/06, Henrik Bengtsson <[EMAIL PROTECTED]> wrote: > > On 4/4/06, Thomas Lumley <[EMAIL PROTECTED]> wrote: > > > On Tue, 4 Apr 2006, Henrik Bengtsson wrote: > > > > > > > Hi, &

[Rd] predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())

2006-04-05 Thread Henrik Bengtsson
rm(length(x)) sp <- smooth.spline(x=x, y=y) ypred <- predict(sp$fit, x) # [1] 2.325181 2.756166 ... ypred2 <- predict(sp$fit, c(0,x)) # Error in Recall(object, xrange) : couldn't find # function "predict.smooth.spline.fit" /Henrik On 4/5/06, Henrik Bengtsson <[EMAIL P

[Rd] Return function from function and Recall()

2006-04-05 Thread Henrik Bengtsson
Hi, yesterday I got very useful feedback on what is the best way to return a function from a function. Now, I run into a problem calling a returned function that down the stream uses Recall(). Below is a self-contained example. I took away yesterday's code for returning a minimal environment fo

Re: [Rd] predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())

2006-04-05 Thread Henrik Bengtsson
On 4/5/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Wed, 5 Apr 2006, Henrik Bengtsson wrote: > > > Hi, > > > > forget about the below details. It is not related to the fact that > > the function is returned from a function. Sorry about that. I'

[Rd] page() (Was: Re: predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall()))

2006-04-05 Thread Henrik Bengtsson
nd no title is set. If you want to, I could play around with a bit. /Henrik On 4/5/06, Kurt Hornik <[EMAIL PROTECTED]> wrote: > >>>>> Prof Brian Ripley writes: > > > On Wed, 5 Apr 2006, Henrik Bengtsson wrote: > >> Hi, [snip] > > As for > >

Re: [Rd] predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())

2006-04-05 Thread Henrik Bengtsson
On 4/5/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Wed, 5 Apr 2006, Henrik Bengtsson wrote: > > > On 4/5/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > >> On Wed, 5 Apr 2006, Henrik Bengtsson wrote: > >> > >>> Hi, > >>&g

Re: [Rd] page() (Was: Re: predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall()))

2006-04-05 Thread Henrik Bengtsson
On 4/5/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Wed, 5 Apr 2006, Henrik Bengtsson wrote: > > > Here I think S3 dispatch is very natural. Try the following: > > I don't: it is documented to work on a name not an object. What comes first, the documentat

Re: [Rd] prevent reassignment of function names

2006-04-06 Thread Henrik Bengtsson
On 4/6/06, Seth Falcon <[EMAIL PROTECTED]> wrote: > Tim Bergsma <[EMAIL PROTECTED]> writes: > > > Hi. > > > > I'm trying to find a systematic way to prevent assignment to names of > > existing functions. > > An alternative would be to put your functions into an R package with a > namespace. Then y

Re: [Rd] Run package code on R shutdown?

2006-04-10 Thread Henrik Bengtsson
for a start. It modifies .Last(), but that can be circumvented by quit(callLast=FALSE). /Henrik > Duncan Murdoch > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] get(name, envir=envir) : formal argument "envir" matched by multiple actual arguments

2006-04-10 Thread Henrik Bengtsson
Hi, very sporadic and non-reproducible, I get the following type of errors: Error in get(name, envir = envir) : formal argument "envir" matched by multiple actual arguments Error in exists(cacheName, envir = envir, inherit = FALSE) : formal argument "envir" matched by multiple actual arguments

[Rd] Suggestions to speed up median() and has.na()

2006-04-10 Thread Henrik Bengtsson
Hi, I've got two suggestions how to speed up median() about 50%. For all iterative methods calling median() in the loops this has a major impact. The second suggestion will apply to other methods too. This is what the functions look like today: > median function (x, na.rm = FALSE) { if (is

Re: [Rd] Suggestions to speed up median() and has.na()

2006-04-11 Thread Henrik Bengtsson
On 4/11/06, Thomas Lumley <[EMAIL PROTECTED]> wrote: > On Mon, 10 Apr 2006, Duncan Murdoch wrote: > > > On 4/10/2006 7:22 PM, Thomas Lumley wrote: > >> On Mon, 10 Apr 2006, Henrik Bengtsson wrote: > >> > >>> Suggestion 2: > >>> Create a h

Re: [Rd] UseMethod infelicity

2006-05-22 Thread Henrik Bengtsson
On 5/20/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > Here are three examples where this matters, and I think the bug is > elsewhere! > > 1) Package accuracy does > > ZeligHooks<-function (...) { > if (exists(".simHooked",envir=.GlobalEnv)) { > return(TRUE) > } > origsim=g

[Rd] save() saves extra stuff if object is not evaluated

2006-05-25 Thread Henrik Bengtsson
Hi, it looks like save() is saving all contents of the calling environments if the object to be saved is *not* evaluated, although it is not that simple either. After many hours of troubleshooting, I'm still confused. Here is a reproducible example (also attached) with output. I let the code a

Re: [Rd] save() saves extra stuff if object is not evaluated

2006-05-25 Thread Henrik Bengtsson
On 5/25/06, Luke Tierney <[EMAIL PROTECTED]> wrote: > On Thu, 25 May 2006, Henrik Bengtsson wrote: > > > Hi, > > > > it looks like save() is saving all contents of the calling > > environments if the object to be saved is *not* evaluated, although it > &g

[Rd] FYI: R-2.3.1pat-win32.exe not on CRAN

2006-06-05 Thread Henrik Bengtsson
FYI, the download link on CRAN for R-2.3.1pat-win32.exe and related files seems to be broken at least since yesterday, e.g. http://cran.at.r-project.org/bin/windows/base/R-2.3.1pat-win32.exe. /Henrik __ R-devel@r-project.org mailing list https://stat.et

Re: [Rd] R Wiki: how useful for developers?

2006-06-19 Thread Henrik Bengtsson
Thank you very much for this Philippe and everyone else who contibuted to the R Wiki. Great initiative and work. I'm interested in the 'R packages section' for adding extra help on my packages. What kind of backup is there for the wiki? Best Henrik On 6/18/06, Philippe Grosjean <[EMAIL PROTEC

Re: [Rd] Documentation issues [Was: Function hints]

2006-06-20 Thread Henrik Bengtsson
I've done a bit on this, but I've kept a low profile because it is "under development". In the R.oo package there is the Rdoc compiler, which compiles Rdoc comments into Rd files. It uses directives such as @include "../incl/myExample.R" and @synopsis (extracting details from the code), @keyword

Re: [Rd] attributes of environments

2006-07-05 Thread Henrik Bengtsson
On 7/5/06, Thomas Lumley <[EMAIL PROTECTED]> wrote: > On Wed, 5 Jul 2006, Gabor Grothendieck wrote: > > > On 7/5/06, Thomas Lumley <[EMAIL PROTECTED]> wrote: > >> On Wed, 5 Jul 2006, Gabor Grothendieck wrote: > >> > >> > On 7/5/06, Thomas Lumley <[EMAIL PROTECTED]> wrote: > >> >> On Tue, 4 Jul 2006

[Rd] Fwd: Generating valid R code using R

2006-07-16 Thread Henrik Bengtsson
Sorry, this question was supposed to go to r-devel; move it there now. /HB -- Forwarded message -- From: Henrik Bengtsson <[EMAIL PROTECTED]> Date: Jul 16, 2006 11:11 AM Subject: Generating valid R code using R To: R-help Hi, I'm trying to generate valid R code usi

[Rd] png() and image()

2006-07-20 Thread Henrik Bengtsson
Hi, I try to create PNG images of a certain size where each pixel intensity corresponds to exactly one probe signal in an Affymetrix array. I try to use png() and image() with zero margins to do this. Example: z <- matrix(1:15, nrow=45, ncol=30) png("large.png", height=nrow(z), width=ncol(z), b

Re: [Rd] png() and image()

2006-07-21 Thread Henrik Bengtsson
what you're trying to do. > Best wishes > Wolfgang > -- > Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber > > Henrik Bengtsson wrote: > > Hi, > > > > I try to create PNG image

[Rd] file.copy() of non-existing file creates empty file

2006-07-22 Thread Henrik Bengtsson
Copying a non-existing file using file.copy() creates empty file. Example: > file.exists("non-existing-file") [1] FALSE > file.copy("non-existing-file", "new-file") > file.exits("new-file") [1] TRUE > file.info("new-file")$size [1] 0 The reason for this is that file.copy() calls file.create() wi

Re: [Rd] pari/gp interface

2006-07-25 Thread Henrik Bengtsson
On 7/25/06, Robin Hankin <[EMAIL PROTECTED]> wrote: > Hi > > I'm developing an R package that > needs to execute some code written in pari/gp. > > I've used this before from an R package (elliptic) but the interface > is very > basic: the R function creates a string such as the following: > > strin

Re: [Rd] pari/gp interface

2006-07-26 Thread Henrik Bengtsson
95/98/ME. If you can ignore those (and they are getting rarer), cmd.exe > can be assumed for use of shell(). > > echo is not a standard system command on Windows either, and in a shell > does not do what it does on Unix. > > On Tue, 25 Jul 2006, Henrik Bengtsson wrote: &g

[Rd] Package digest broken under R v2.4.0 devel

2006-07-27 Thread Henrik Bengtsson
[cc:ing to the maintainer of digest] FYI, package 'digest' (v0.2.1 2005/11/04 04:45:53) generates the same output regardless of input with R v2.4.0 devel (2006-07-25 r38698). Starting a vanilla R session you get: > library(digest) > digest(1) [1] "3416a75f4cea9109507cacd8e2f2aefc" > digest(2) [1]

Re: [Rd] Package digest broken under R v2.4.0 devel

2006-07-28 Thread Henrik Bengtsson
st.R";) Its possible that it is faster to serialize to a 'textConnection'. However, it might be even faster if your internal code, i.e. .Call("digest", ...), accepts vectors so this does not have to be done at the R level? Cheers Henrik On 7/27/06, Henrik Bengtsson <[EMAI

Re: [Rd] [R] HTTP User-Agent header

2006-07-28 Thread Henrik Bengtsson
On 7/28/06, Robert Gentleman <[EMAIL PROTECTED]> wrote: > I wonder if it would not be better to make the user agent string > something that is configurable (at the time R is built) rather than at > run time. This would make Seth's patch about 1% as long. Or this could > be handled as an option. The

[Rd] In memory caching algorithm

2006-08-12 Thread Henrik Bengtsson
Hi, quite a few times I have ran into problems where I would like to read data from a data source too huge to keep in memory. Not only this, but retrieving the data from that source is a bit slow. I wish to work with only small chunks of the data in memory at any time. Now, sometimes the same d

[Rd] Data frames and row names

2006-08-14 Thread Henrik Bengtsson
In R-devel v2.4.0 NEWS: o The 'row.names' of a data frame may be stored internally as an integer or character vector. This can result in considerably more compact storage (and more logical row names from rbind) when the row.names are 1:nrow(x). However, such data fr

Re: [Rd] Data frames and row names

2006-08-15 Thread Henrik Bengtsson
On 8/14/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Mon, 14 Aug 2006, Henrik Bengtsson wrote: > > > In R-devel v2.4.0 NEWS: > > > > o The 'row.names' of a data frame may be stored internally as an > > integer or character vector.

Re: [Rd] sort changes datatype of operand

2006-08-18 Thread Henrik Bengtsson
On 8/18/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > Please do note that this too is a reading error. The documentation for > rowsum() says > >group: a vector giving the grouping, with one element per row of > 'x'. > > R has used 'group' as if it were as.vector(group), as it was

[Rd] Suggestion: seek(..., rw="last") instead of seek(..., rw="")

2006-08-19 Thread Henrik Bengtsson
Hi. In seek() the 'rw' argument takes three possible values, i.e. "" (empty), "read", or "write" (partial matches allowed). I was bitten by the meaning of "" when I in a loop used seek(con, where=w) followed by a seek(con, where=w, rw="write"). I know that everything is (magically) in the help (

Re: [Rd] S4 Methods dispatch

2006-08-30 Thread Henrik Bengtsson
[Cross-posting to BioC-devel to] Thank you for this. > The changes are internal but extensive. All packages that use S4 > methods and classes need to be reinstalled from source to use the new > version. Is there an easy way to detect if a package is using S4 or not? If so, I could scan my alre

Re: [Rd] S4 Methods dispatch

2006-08-30 Thread Henrik Bengtsson
On 8/30/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Wed, 30 Aug 2006, Henrik Bengtsson wrote: > > > [Cross-posting to BioC-devel to] > > > > Thank you for this. > > > > > The changes are internal but extensive. All packages that use S4 >

Re: [Rd] Unexpected source() behavior in R-devel

2006-09-03 Thread Henrik Bengtsson
This has been reported before on r-devel, e.g. May 9, 2006 "[Rd] Seg fault when installing package from bad repository". It's happening on Mac OSX when trying to download non-existing webpages (HTTP status 404). That's all I know (not using OSX myself). /Henrik On 03 Sep 2006 23:06:01 +0200, Pet

Re: [Rd] Unexpected source() behavior in R-devel

2006-09-03 Thread Henrik Bengtsson
On 9/4/06, Sean Davis <[EMAIL PROTECTED]> wrote: > Seth Falcon wrote: > > Peter Dalgaard <[EMAIL PROTECTED]> writes: > > > > > >> "Henrik Bengtsson" <[EMAIL PROTECTED]> writes: > >> > >> > >>> This has been re

[Rd] R CMD check: unstated dependence on a standard package.

2006-09-07 Thread Henrik Bengtsson
In the recent R-devel version, I receive the following error: * checking whether the package can be loaded with stated dependencies ... WARNING Error in doTryCatch(return(expr), name, parentenv, handler) : could not find function "packageDescription" Error in library(R.oo) : .First.lib fai

[Rd] example(..., ask=getOption("example.ask"))

2006-09-13 Thread Henrik Bengtsson
Hi, I wish to return to the topic "[Rd] example(ask = .) - default ?" discussed in R-devel on May 1, 2006, because I think it is related to my problem. In one of my Rd examples I generate multiple (20-30!) PNG files using png()/dev.off(). I noticed that I get a "Hit to see next plot:" for each

Re: [Rd] wishlist --- menu entry [Rgui] misc --- stop current computation

2006-09-19 Thread Henrik Bengtsson
On 9/19/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Tue, 19 Sep 2006, Kjetil Halvorsen wrote: > > > This is from R-2.4.0alpha on windows XP, downloaded from CRAN yesterday. > > > > I did > > update.packages(destdir= ..., ask=FALSE,checkBuilt=TRUE) > > > > which took quite a long time (as.

[Rd] Parsing of 10xff

2006-09-22 Thread Henrik Bengtsson
Is the following an error in the parser? > 10xff [1] 10 /Henrik __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] R CMD check and x11?

2006-09-25 Thread Henrik Bengtsson
You can close the x11() device using dev.off() in your example. You may also want to look at interactive() so you can test in your example is the code is run interactively or not; the latter is the case for R CMD check. /H On 9/25/06, Dominick Samperi <[EMAIL PROTECTED]> wrote: > One of my demos

Re: [Rd] S4 accessors

2006-09-27 Thread Henrik Bengtsson
On 9/27/06, John Chambers <[EMAIL PROTECTED]> wrote: > There is a point that needs to be remembered in discussions of accessor > functions (and more generally). > > We're working with a class/method mechanism in a _functional_ language. > Simple analogies made from class-based languages such as Jav

Re: [Rd] documenation duplication and proposed automatic tools

2006-10-02 Thread Henrik Bengtsson
Hi. Far from complete, but some sketches on a solution is in the Rdoc-to-Rd translator of the R.oo package. I, the author, never made this very public because it uses a very ugly parser etc for it, but the basics is there and I use it to generate \usage{} statements and class hierarchies automati

[Rd] exists(..., inherits) & get(..., inherits)

2006-10-04 Thread Henrik Bengtsson
Hi, are there corresponding methods to exists() and get() where one can stratify on class, e.g. exists(..., inherits) instead of exists(..., mode)? Thanks Henrik __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] Extreme slowdown with named vectors. A bug?

2006-10-06 Thread Henrik Bengtsson
Tried the following with R --vanilla on the Rv2.4.0 release (see details at the end). I think the script and its comments speaks for itself, but the outcome is certainly not wanted. for (n in 58950:58970) { cat("n=", n, "\n", sep=""); # Clean up first rm(names, x, y); gc(); # Create a n

Re: [Rd] Extreme slowdown with named vectors. A bug?

2006-10-06 Thread Henrik Bengtsson
Thank *you* for identifying the source of the problem and fixing. :) /Henrik On 10/6/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 10/6/2006 6:20 PM, Henrik Bengtsson wrote: > > Tried the following with R --vanilla on the Rv2.4.0 release (see > > details at the end). I

[Rd] Error: invalid multibyte string

2006-10-25 Thread Henrik Bengtsson
I'm observing the following on different platforms: > parse(text='"\\x7F"') expression("\177") > parse(text='"\\x80"') Error: invalid multibyte string ... > parse(text='"\\xFF"') Error: invalid multibyte string However, cat("\x7F\n\x80\n...\xFF\n") works. Using R --vanilla. SYSTEMS GIVING THE

Re: [Rd] Error: invalid multibyte string

2006-10-26 Thread Henrik Bengtsson
lains. This is exactly what Peter pointed out in his example. Cheers Henrik On 26 Oct 2006 18:43:45 +0200, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > Thomas Lumley <[EMAIL PROTECTED]> writes: > > > On Thu, 26 Oct 2006, Henrik Bengtsson wrote: > > > &g

Re: [Rd] Error: invalid multibyte string

2006-10-27 Thread Henrik Bengtsson
On 10/28/06, Thomas Lumley <[EMAIL PROTECTED]> wrote: > On Fri, 27 Oct 2006, Henrik Bengtsson wrote: > > > In Section "Package subdirectories" in "Writing R Extensions" [2.4.0 > > (2006-10-10)] it says: > > > > "Only ASCII characters (an

Re: [Rd] Error: invalid multibyte string

2006-10-29 Thread Henrik Bengtsson
On 10/28/06, Henrik Bengtsson <[EMAIL PROTECTED]> wrote: > On 10/28/06, Thomas Lumley <[EMAIL PROTECTED]> wrote: > > On Fri, 27 Oct 2006, Henrik Bengtsson wrote: > > > > > In Section "Package subdirectories" in "Writing R Extensions" [2.

Re: [Rd] [R] Problem with file size

2006-11-13 Thread Henrik Bengtsson
[Moved to r-devel for further discussion, bcc:ed r-help for the record] Hi Benilton, it is possible that this has to do with so called unevaluated promises. I had a similar problem a few months ago. I emailed R-devel about it - "[Rd] save() saves extra stuff if object is not evaluated" (Thu May

Re: [Rd] caching frequently used values

2006-12-13 Thread Henrik Bengtsson
I use the R.oo Object class for what has been suggested previously. The Object class can be thought of as utility wrapper class for environments (actually environments gained much of its behavior some time ago when "$" etc was being mapped to get() calls). For caching to file, take a look at the R

Re: [Rd] Wish list

2007-01-02 Thread Henrik Bengtsson
On 1/2/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 1/1/2007 12:59 PM, Charles C. Berry wrote: > > On Mon, 1 Jan 2007, Duncan Murdoch wrote: > > > >> A few comments thrown in, and some general comments at the bottom. > >> > >> On 1/1/2007 1:28 AM, Gabor Grothendieck wrote: > >>> This is my 20

Re: [Rd] Which programming paradigm is the most used for make R packages?

2007-01-03 Thread Henrik Bengtsson
On 1/4/07, Ross Boylan <[EMAIL PROTECTED]> wrote: > On Wed, Jan 03, 2007 at 11:46:16AM -0600, Ricardo Rios wrote: > > Hi wizards, does somebody know Which programming paradigm is the most > > used for make R packages ? Thanks in advance. > > > You need to explain what you mean by the question, for

<    4   5   6   7   8   9   10   >