[Rd] R-gui and chinese character

2008-04-24 Thread Dieter Menne
I had to test an R-application that works with Chinese character. Just for fun, I took one character from WikiPedia, pasted it into R-Gui, and pressed enter. Rgui smoothly closed down without saying anything else. I am aware, this is not serious 鳳 R version 2.7.0 (2008-04-22) Windows Vista,

Re: [Rd] R-gui and chinese character

2008-04-24 Thread Prof Brian Ripley
On Thu, 24 Apr 2008, Dieter Menne wrote: I had to test an R-application that works with Chinese character. Just for fun, I took one character from WikiPedia, pasted it into R-Gui, and pressed enter. Rgui smoothly closed down without saying anything else. I am aware, this is not serious 鳳

[Rd] Calling R functions with multiple arguments from C

2008-04-24 Thread Rossouw, Ruan (RF)
Hi, I'm writing a C function that has to call a R function with multiple arguments. I've read the relevant section in Writing R Extensions, and searched the R site, mailing lists as well as rseek. I managed to call the function, but I'm now having trouble creating the argument list. I tried to cr

Re: [Rd] Calling R functions with multiple arguments from C

2008-04-24 Thread Prof Brian Ripley
Try PrintValue(R_fcall): function(x,y)match.call() (list(x = 10, y = 12)) You want a pairlist of length 1+nargs, not a pairlist of pairlists. Here is one way to do it (there are many) #include SEXP foo(SEXP fn, SEXP elmt1, SEXP elmt2, SEXP rho) { SEXP R_fcall, args, ans,s; PROTECT(

Re: [Rd] (PR#11240)

2008-04-24 Thread Simon Urbanek
Please follow the posting guide before reporting bugs! You have failed to even follow the instruction from the page you got the image from - this is long fixed (the update was posted 5 days after the affected R 2.6.2 release). Cheers, Simon On Apr 22, 2008, at 10:15 AM, [EMAIL PROTECTED] wr

Re: [Rd] S4 default for coercing

2008-04-24 Thread Martin Maechler
Yes, there's a change from R 2.6.2 to 2.7.0 that might have been unintended and hence a bug. The short version is this setClassUnion("OptionalPOSIXct", c("POSIXct", "NULL")) as(Sys.time(), "OptionalPOSIXct", strict=FALSE) which now gives >> Error .. >> no method or default for coe

[Rd] RFC: What should ?foo do?

2008-04-24 Thread Duncan Murdoch
Currently ?foo does help("foo"), which looks for a man page with alias foo. If foo happens to be a function call, it will do a bit more, so ?mean(something) will find the mean method for something if mean happens to be an S4 generic. There are also the type?foo variations, e.g. methods?foo, o

Re: [Rd] R-devel Digest, Vol 62, Issue 24

2008-04-24 Thread John Maindonald
The columns of the model matrix are all orthogonal. So the problem lies with poly(), not with lm(). > x = rep(1:5,3) y = rnorm(15) z <- model.matrix(lm(y ~ poly(x, 12))) x = rep(1:5,3) > y = rnorm(15) > z <- model.matrix(lm(y ~ poly(x, 12))) > round(crossprod(z),15) (Interc

Re: [Rd] R-devel Digest, Vol 62, Issue 24

2008-04-24 Thread John Maindonald
Actually, this may be a useful feature! It allows calculation of a basis for the orthogonal complement of the space spanned by model.matrix(lm(y ~ poly(x,12)). However, the default ought surely to be to disallow df > k-1 in poly(x,df), where k = length(unique(x)). John Maindonald

Re: [Rd] poly() can exceed degree k - 1 for k distinct points (PR#11251)

2008-04-24 Thread Steven McKinney
I haven't parsed the source to fully understand the 'normalization constants' returned in the poly output component attr(,"coefs")$norm2 but notice that the first 6 are non-zero and the last 8 are smaller than machine precision. Some kind of useful warning to the user could ensue upon evaluatio

Re: [Rd] RFC: What should ?foo do?

2008-04-24 Thread Marc Schwartz
Duncan Murdoch wrote: > Currently ?foo does help("foo"), which looks for a man page with alias > foo. If foo happens to be a function call, it will do a bit more, so > > ?mean(something) > > will find the mean method for something if mean happens to be an S4 > generic. There are also the type

Re: [Rd] RFC: What should ?foo do?

2008-04-24 Thread hadley wickham
> I am not convinced that ?foo should do this however. help("foo") > conceptually seems predicated upon the notion that a user is looking for > a reference/help page for a specific function or descriptor called > 'foo'. The user knows the name of the function or descriptor and should > not hav

Re: [Rd] RFC: What should ?foo do?

2008-04-24 Thread Prof Brian Ripley
On Thu, 24 Apr 2008, hadley wickham wrote: >> I am not convinced that ?foo should do this however. help("foo") >> conceptually seems predicated upon the notion that a user is looking for >> a reference/help page for a specific function or descriptor called >> 'foo'. The user knows the name of

[Rd] Bug in R 2.7 for over long lines

2008-04-24 Thread Soeren Sonnenburg
While trying to fix swig & R2.7 I actually discovered that there is a bug in R 2.7 causing a crash (so R & swig might actually work): the bug is in ./src/main/gram.c line 3038: } else { /* over-long line */ fixthis --> char *LongLine = (char *) malloc(nc); if(!LongLine)