Re: [Rd] Writing a package in which files must be sourced in a specific order

2007-02-22 Thread hadley wickham
> What 'alphabetical order' is depends on the locale. In en_NZ g < G, in C > G < g. So it is a rather slippery concept (and gets worse in non-English > locales: 'aa' sorts after z in Danish). I only used characters a-z, so I didn't think that would be a problem. However, it turns out I had misn

Re: [Rd] Writing a package in which files must be sourced in a specific order

2007-02-22 Thread Prof Brian Ripley
What 'alphabetical order' is depends on the locale. In en_NZ g < G, in C G < g. So it is a rather slippery concept (and gets worse in non-English locales: 'aa' sorts after z in Danish). You don't tell us quite what you are doing, but R CMD INSTALL is working in C when concatenating the files i

Re: [Rd] Writing a package in which files must be sourced in a specific order

2007-02-22 Thread Oleg Sklyar
Put all loadings into functions and call the functions in .onLoad or .FirstLib, whatever you have there. I would simply advise not to put any code outside of functions or class methods. In this way the order of loading will not matter, it will not depend on system or alphabet and you will als

Re: [Rd] How to override functions in namespaces?

2007-02-22 Thread Duncan Murdoch
On 2/12/2007 1:13 PM, [EMAIL PROTECTED] wrote: > In package A I have askForString(), which asks the user for a string. > Also in package A I have defined ssh(), which calls askForString(). > > Package B has package A as a prerequisite. > > In package B I redefine askForString() to take advantage

Re: [Rd] (PR#9523) avoiding a needless function evaluation in optimize()

2007-02-22 Thread Prof Brian Ripley
This is very far from easy, as the C code used does not return the function value. If you would like to rewrite it and the interface and submit a patch it will be considered. It's hard to imagine an application where this would matter, and you have not given one to encourage us to give this mo

Re: [Rd] How to override functions in namespaces?

2007-02-22 Thread Prof Brian Ripley
On Mon, 12 Feb 2007, [EMAIL PROTECTED] wrote: > In package A I have askForString(), which asks the user for a string. > Also in package A I have defined ssh(), which calls askForString(). > > Package B has package A as a prerequisite. > > In package B I redefine askForString() to take advantage of

Re: [Rd] Problem with types on 64-bit

2007-02-22 Thread Oleg Sklyar
Besides the comments from Prof. Ripley, I am not sure your if statement is fully correct, because suppose v_dta_start is R_NilValue -- why then STRING_ELT( R_NilValue, 0 ) should be a valid statement in first place? In my code I often use R_NilValue to check for R-NULL, but it always works fine

[Rd] Writing a package in which files must be sourced in a specific order

2007-02-22 Thread hadley wickham
Dear all, I have been using the proto package to create objects with mutable state for my ggplot package. This has been very successful so far, but I have run into a problem when building/installing the package, because the source files need to be loaded in a specific order so that dependencies a

Re: [Rd] memory problem read.table v array (PR#9526)

2007-02-22 Thread Prof Brian Ripley
There is nothing to reproduce here: we do not have 639.txt. But note that read.table returns a data frame, and ?array has data: a vector (including a list) giving data to fill the array. so I do wonder if this is what you intended: you seem to have tried to create an array list with 639*63

Re: [Rd] Problem with types on 64-bit

2007-02-22 Thread Prof Brian Ripley
Neither NULL nor "hello" are valid values for an element of a STRSXP: only CHARSXPs are. So your test is not the correct one: you need to test both isString(v_dta_start) and TYPEOF(STRING_ELT( v_dta_start, 0 )) == CHARSXP to be really safe. Calling STRSXP on a random SEXP is likely to give di

[Rd] Error in ICC1.CI ? (PR#9528)

2007-02-22 Thread Mathieu . DAcremont
Hello, I'm using the function ICC1.CI of the psychometric package. I wonder if there is an error in this function. Because in the paper of McGraw and Wong (Psychol Met, 1, 30) or the one of Shrout & Fleiss (Psychol Bult, 86, 420), the Ftab is not calculate in the same manner of the lower and

Re: [Rd] rgl update: please test!

2007-02-22 Thread Rainer Hurling
Hallo Duncan, your newest version works fine under R-2.5.0 (devel) on FreeBSD 7.0-CURRENT (i386). I made some tests with different types of diagrams and all seems to be ok for me. Thank you very much. I am look forward to the release of this version. Have a nice trip, Rainer Duncan Murdoch

[Rd] Problem with types on 64-bit

2007-02-22 Thread tom
Hi Everyone, I have a problem using some working 32-bit R code with 64-bit machine ( I am using version R-2.4.1 ). The problem occurs when I am trying to detect a NULL STRSXP type. ( Perhaps I am doing this detection in the wrong way? ) On 32-bit the following works, and correctly identifies if

[Rd] memory problem read.table v array (PR#9526)

2007-02-22 Thread wlangdon
Full_Name: bill langdon Version: 2.4.1 OS: ubuntu Submission from: (NULL) (155.245.58.159) #WBL 22 Feb 2007 ubuntu R.version #platform i486-pc-linux-gnu #arch i486 #os linux-gnu #system i486, linux-gnu #status #major 2 #minor 4.1 #year

[Rd] lower.tail for plnorm (PR#9520)

2007-02-22 Thread candrews
Full_Name: Chris Andrews Version: 2.4.1 OS: Windows XP Submission from: (NULL) (128.205.90.25) # CDF works as expected (=0) pnorm(-Inf) # 0 plnorm(0) # 0 # specifying lower.tail=FALSE should give survival function (=1) pnorm(-Inf, lower.tail=FALSE) # 1 plnorm(0, lower.tail=FALSE) # 0 != 1 ___

[Rd] avoiding a needless function evaluation in optimize() (PR#9523)

2007-02-22 Thread j . j . goeman
Full_Name: Jelle Goeman Version: 2.4.0 OS: windows XP Submission from: (NULL) (145.88.209.33) Hi, I like to use optimize() to optimize functions whose evaluation is costly in terms of computation time. The Brent algorithm which is implemented in optimize was designed to optimize a function with

[Rd] R crashes in Mac OS

2007-02-22 Thread Giusi Moffa
I am running R under Mac OS X (Tiger, v10.4). Unfortunately it keeps crashing while using the editor. One thing that seems to make things worse is having more than one script open at the same time. Can anyone help? The last time it happened I got the following messages error message from R:

[Rd] supsmu produces segfault when handed all NAs. (PR#9519)

2007-02-22 Thread boe
When handed an argument with all NAs, supsmu() causes a sigfault causing termination of R. The following example reproduces the problem (on a linux gentoo system), but I have verified the same behavior on a solaris builds as well as several versions of R. x <- (1:100)/10; y <- sin(pi*x) +

[Rd] Request: make as.POSIXlt generic

2007-02-22 Thread jhallman
In the base package, as.POSIXct() is an S3 generic function, but as.POSIXlt() is not. As shown below, the current implementation is already crying out to be refactored into a generic function with methods for various classes. It calls "inherits" five times. Not only is this bad style, it also dis

[Rd] Graphical device questions

2007-02-22 Thread Sebastien Durand
Dear all, I have posted these questions in r-help list but since I am getting no reply, I concluded that I must asked my question in the wrong list so here I am! Here is my questions: 1- Under a WINDOWS installation of R-2.4.1, can we change the naming of a new ploting device open by the c

[Rd] Windows EPS format error (PR#9518)

2007-02-22 Thread mwtoews
This bug can be reproduced using R version 2.4.1 for Windows, where WinAnsiEncoding is used. To reproduce this bug, start a Windows R session, and run: postscript("first.eps", width=6, height=6, horizontal=FALSE, onefile=FALSE, paper="special") plot(1:5) dev.off() q("no") Now, start a new R ses

[Rd] MCMC Pack Crashes R-GUI session (PR#9516)

2007-02-22 Thread lloydl
Full_Name: Lloyd Lubet Version: 2.4.1rc OS: XP Submission from: (NULL) (65.19.17.17) Dear Andrew, I am trying to learn gibbs sampling and Metropolis. When I run your gibbs version of multiple linear regression my session crashes. I have trimmed the dataframe and set my object.size = 1 gigB. Des

[Rd] dyn.load (PR#9364)

2007-02-22 Thread Christophe . Jean
Hi, I have exactly the same problem with R 2.4.1 on an Intel MacBook with Mac OS X 10.4.8. Please find below the output of the test. Christophe --- > source("/Users/Christophe/Desktop/Rdynunload/run.R") WARNING: ignoring environment value of R_HOME gcc-4.0 -arch i386 -I/Library/Frameworks/R.f

[Rd] How to override functions in namespaces?

2007-02-22 Thread jhallman
In package A I have askForString(), which asks the user for a string. Also in package A I have defined ssh(), which calls askForString(). Package B has package A as a prerequisite. In package B I redefine askForString() to take advantage of a nicer user interface made available by B, namely the E

[Rd] text.rpart for the "class" method doesn't act on label="yprob"

2007-02-22 Thread Robert King
Hello All, Am I misreading the documentation? The text.rpart documentation says: "label a column name of x$frame; values of this will label the nodes. For the "class" method, label="yval" results in the factor levels being used, "yprob" results in the probability of the winning factor level bei

[Rd] Bug in httpget function for internet.Rout test (PR#9509)

2007-02-22 Thread plynchnlm
Full_Name: Paul Lynch Version: 2.4.1 OS: RedHat EL4 Submission from: (NULL) (130.14.254.25) The httpget function used for the test that produces the internet.Rout file (or in my case, the internet.Rout.fail file) checks for a "Content-Length" header returned from a webserver in response to the U

[Rd] Patch for "units<-" in datetime.R

2007-02-22 Thread Jeffrey Horner
Index: src/library/base/R/datetime.R === --- src/library/base/R/datetime.R (revision 40781) +++ src/library/base/R/datetime.R (working copy) @@ -381,7 +381,7 @@ if (from == value) return(x) if (!(value %in% c(

Re: [Rd] R_tryEval not properly documented in 'Writing R Extensions' (PR#9524)

2007-02-22 Thread Byron Ellis
Considering the lack of embedding documentation until relatively recently, the fact that the function appeared in Rinternals and the Embedding test cases makes it more part of the API that its appearance in any documentation since anyone embedding would have to base their work on those test cases.

[Rd] rgl update: please test!

2007-02-22 Thread Duncan Murdoch
(This is bcc'd to a list of people who have had problems with rgl lately or who are known to be big users; not cc'd, so you don't all get cc'd all the responses on the R-devel list). I've just put together a test build of rgl, and put it on my web site as http://www.stats.uwo.ca/faculty/murdoch

Re: [Rd] R_tryEval not properly documented in 'Writing R Extensions' (PR#9525)

2007-02-22 Thread ripley
On Thu, 22 Feb 2007, [EMAIL PROTECTED] wrote: > Full_Name: Byron Ellis > Version: 2.4.1 > OS: N/A > Submission from: (NULL) (75.55.126.10) > > > R_tryEval is implied to be in the public API by 'Embedding R in Other > Applications,' but not documented in 'Writing R Extensions.' This would seem > t

Re: [Rd] R_tryEval not properly documented in 'Writing R Extensions' (PR#9524)

2007-02-22 Thread Prof Brian Ripley
On Thu, 22 Feb 2007, [EMAIL PROTECTED] wrote: > Full_Name: Byron Ellis > Version: 2.4.1 > OS: N/A > Submission from: (NULL) (75.55.126.10) > > > R_tryEval is implied to be in the public API by 'Embedding R in Other > Applications,' but not documented in 'Writing R Extensions.' This would seem > t

[Rd] R_tryEval not properly documented in 'Writing R Extensions' (PR#9524)

2007-02-22 Thread ellis
Full_Name: Byron Ellis Version: 2.4.1 OS: N/A Submission from: (NULL) (75.55.126.10) R_tryEval is implied to be in the public API by 'Embedding R in Other Applications,' but not documented in 'Writing R Extensions.' This would seem to be an oversight given the dependence of many applications incl