Re: [Rd] Problem installing from source: no CONTENTS files

2006-01-09 Thread Mark.Bravington
> Brian D. Ripley, [EMAIL PROTECTED] > This will only happen if you installed R without HTML help > and then install a package *with* HTML help *and* do so into > a non-standard directory. That seems an arcane thing to do: > why do you want HTML help for some packages and not

Re: [Rd] Wikis (was about prod(numeric(0)))

2006-01-09 Thread Tony Plate
I agree with everything you say about the structure and organization of the Wiki (needs top-level R-related structure, the Wiki-administration/editing stuff dominates, etc.) But, it's also possible to spend so much time talking about how to do it, that it never gets done... Still, it really d

[Rd] Wikis (was about prod(numeric(0)))

2006-01-09 Thread Ben Bolker
Tony Plate acm.org> writes: > > Since the virtue and reliability of Wikis was brought up, I created a R > Wiki page for this at > http://www.sciviews.org/_rgui/wiki/doku.php?id=beginners:surprises:emptysetfuncs > > > Anyone: please correct errors and improve it! > > Tony Plate > O

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Tony Plate
Since the virtue and reliability of Wikis was brought up, I created a R Wiki page for this at http://www.sciviews.org/_rgui/wiki/doku.php?id=beginners:surprises:emptysetfuncs :-) Anyone: please correct errors and improve it! Tony Plate Duncan Murdoch wrote: > On 1/9/2006 1:27 PM, Liaw, Andy wr

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Simon Urbanek
On Jan 9, 2006, at 3:35 PM, Kjetil Halvorsen wrote: > But this thread seems to have pointed to some inconsistencies: > >> cumprod( numeric(0) ) > numeric(0) >> cumsum( numeric(0) ) > numeric(0) > > shouldn't this give the same as prod() and sum() in this case? No - as Thomas explained very nicely

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Kjetil Halvorsen
But this thread seems to have pointed to some inconsistencies: > cumprod( numeric(0) ) numeric(0) > cumsum( numeric(0) ) numeric(0) shouldn't this give the same as prod() and sum() in this case? Same with cummin() and cummax(). Kjetil On 1/9/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > > On

Re: [Rd] [R] ouml in an .Rd

2006-01-09 Thread Paul Gilbert
(moved from r-help) Ok, UTF-8 works on some of my machines and latin1 on others. If I use one I get failure or spurious characters when I build on the wrong machine. Are .Rd files suppose to work on different platforms when there are special characters, or is this a known limitation? Paul Pro

Re: [Rd] Interfacing R and C++

2006-01-09 Thread Sean Davis
On 1/9/06 3:20 PM, "Prof Brian Ripley" <[EMAIL PROTECTED]> wrote: > The wrapper function must be in extern "C" {} since you want to give it a > C name (and not a mangled C++ one). These days, the headers probably do > not need to be, but in theory if they are C headers they should be in any >

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Prof Brian Ripley
On Mon, 9 Jan 2006, Thomas Lumley wrote: > On Mon, 9 Jan 2006, Martin Morgan wrote: > >> I guess I have to say yes, I'd exepct >> >> x <- 1:10 >> sum(x[x>10]) ==> numeric(0) >> >> this would be reinforced by recongnizing that numeric(0) is not zero, >> but nothing. I guess the summation over an

Re: [Rd] Interfacing R and C++

2006-01-09 Thread Prof Brian Ripley
The wrapper function must be in extern "C" {} since you want to give it a C name (and not a mangled C++ one). These days, the headers probably do not need to be, but in theory if they are C headers they should be in any C++ code. I think R-exts is quite clear on this: To use with @R{}, the

[Rd] Interfacing R and C++

2006-01-09 Thread Sean Davis
I have a single c++ file that contains a class and a "wrapper" function that has C-like syntax for interacting with the Class. Basically, this wrapper function just makes an instance of the class and then organizes the data for return to R. #include void myFunc(double *data, int *n, double *p

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Thomas Lumley
On Mon, 9 Jan 2006, Martin Morgan wrote: > I guess I have to say yes, I'd exepct > > x <- 1:10 > sum(x[x>10]) ==> numeric(0) > > this would be reinforced by recongnizing that numeric(0) is not zero, > but nothing. I guess the summation over an empty set is an empty set, > rather than a set contain

Re: [Rd] confint/nls

2006-01-09 Thread Prof Brian Ripley
These are all solved, except those for "plinear", where you cannot profile linear parameters and so you must specify parms (or call confint(profile(fm)). And the third plinear model does not converge, so isn't a useful test. On Sat, 7 Jan 2006, Ben Bolker wrote: > > I have found some "issue

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Martin Morgan
Duncan Murdoch <[EMAIL PROTECTED]> writes: > On 1/9/2006 1:27 PM, Liaw, Andy wrote: >> If you haven't seen this in your math courses, perhaps this would help: >> http://en.wikipedia.org/wiki/Empty_set >> > > This is what is so great about Wikipedia: it gives certainty where > I'd only call it a f

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Duncan Murdoch
On 1/9/2006 1:27 PM, Liaw, Andy wrote: > If you haven't seen this in your math courses, perhaps this would help: > > http://en.wikipedia.org/wiki/Empty_set > This is what is so great about Wikipedia: it gives certainty where I'd only call it a fairly standard convention. ;-) Duncan Murdoch

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Liaw, Andy
If you haven't seen this in your math courses, perhaps this would help: http://en.wikipedia.org/wiki/Empty_set which says, in part: Operations on the empty set Operations performed on the empty set (as a set of things to be operated upon) can also be confusing. (Such operations are nullary oper

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Martin Morgan
I guess I have to say yes, I'd exepct x <- 1:10 sum(x[x>10]) ==> numeric(0) this would be reinforced by recongnizing that numeric(0) is not zero, but nothing. I guess the summation over an empty set is an empty set, rather than a set containing the number 0. Certainly these exp(x[x>10]) ==> nume

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Gabor Grothendieck
The way to think about it is: prod(rep(x,n)) == x^n and that works for n=0 too. On 1/9/06, Martin Morgan <[EMAIL PROTECTED]> wrote: > I'm a little confused. I understand that numeric(0) means an empty > numeric vector, not the number 0 expressed as numeric. As it is now, > prod(numeric(0)) ge

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Duncan Murdoch
On 1/9/2006 12:40 PM, Martin Morgan wrote: > I'm a little confused. I understand that numeric(0) means an empty > numeric vector, not the number 0 expressed as numeric. As it is now, > prod(numeric(0)) generates something -- a vector of length 1 > containing the number 1 -- from nothing. I would ha

Re: [Rd] prod(numeric(0)) surprise

2006-01-09 Thread Martin Morgan
I'm a little confused. I understand that numeric(0) means an empty numeric vector, not the number 0 expressed as numeric. As it is now, prod(numeric(0)) generates something -- a vector of length 1 containing the number 1 -- from nothing. I would have expected prod(numeric(0)) ==> numeric(0) this

Re: [Rd] R plot display problem under windows when using python rpy module.

2006-01-09 Thread Hin-Tak Leung
Thanks a lot for the comment and discussion. A few of mine below. Bo Peng wrote: > The main difference is that rpy does one-way communication, is simpler > than RSPython, than is easier to use. > > > I am not an expert on RSPython. I tried RSPython and rpy and chose rpy > for the following rea

Re: [Rd] R plot display problem under windows when using python rpy module.

2006-01-09 Thread Bo Peng
> I was wondering > what is the difference between rpy and RSPython. The main difference is that rpy does one-way communication, is simpler than RSPython, than is easier to use. > So I have a question for you - why rpy instead of RSPython? Have you > tried both, and can you give a comparison of p

Re: [Rd] R plot display problem under windows when using python rpy module.

2006-01-09 Thread Hin-Tak Leung
Hi, (off topic slightly, and a slight flame-bait...). I don't have an answer or clue to your question, but I have played with PSPython briefly and it did work somewhat for me (and I have not heard of rpy until reading this through r-devel), and I was wondering what is the difference between rpy an

Re: [Rd] R plot display problem under windows when using python rpy module.

2006-01-09 Thread Bo Peng
On 1/9/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > How is Rpy calling R? Presumably R is running single-threaded, and the > problem is likely to be that Rpy is using blocking I/O on the R process > and hence blocking the GUI callbacks that drive the window. > > The not-so-simple answer is n

Re: [Rd] R plot display problem under windows when using python rpy module.

2006-01-09 Thread Prof Brian Ripley
How is Rpy calling R? Presumably R is running single-threaded, and the problem is likely to be that Rpy is using blocking I/O on the R process and hence blocking the GUI callbacks that drive the window. The not-so-simple answer is not to do it that way. It might be well sufficient to turn wind

[Rd] R plot display problem under windows when using python rpy module.

2006-01-09 Thread Bo Peng
Dear list, Rpy is a python module that provides python interface to R. The following simple commands >>> from rpy import * >>> r.plot(0) is supposed to create a window that displays the result of plot(0). However, we observe that 1. Under *nix, rpy+R+python work as expected 2. Under windows, p

Re: [Rd] Problem installing from source: no CONTENTS files

2006-01-09 Thread Prof Brian Ripley
This will only happen if you installed R without HTML help and then install a package *with* HTML help *and* do so into a non-standard directory. That seems an arcane thing to do: why do you want HTML help for some packages and not others? You will end up with a partially functional system.