[Rd] lm combined with splines

2010-02-09 Thread Randriamiharisoa Alex
Hello, In the following I tried 3 versions of an example in R help. Only the two first predict command work. After : library(splines) require(stats) 1) fm1 - lm(weight ~ bs(height, df = 5), data = women) ht1 - seq(57, 73, len = 200) ph1 - predict(fm1, data.frame(height=ht1)) # OK

Re: [Rd] lm combined with splines

2010-02-09 Thread Prof Brian Ripley
This is really a question for R-help: it is not about R development nor software development in R. The answer to the only question I see is simple: your model depends on 'fb3' and you supplied 'height'. On Tue, 9 Feb 2010, Randriamiharisoa Alex wrote: Hello, In the following I tried 3

[Rd] Confusing error message for [[.factor (PR#14209)

2010-02-09 Thread g . russell
Full_Name: George Russell Version: 2.10.0 and 2.11.0 Under development (unstable) (2010-02-08 r51108) OS: Windows Submission from: (NULL) (217.111.3.131) c(a,b)[[c(TRUE,FALSE)]] Error in `[[.default`(factor(c(a, b)), c(TRUE, FALSE)) : recursive indexing failed at level 1 I find this error

Re: [Rd] Confusing error message for [[.factor (PR#14209)

2010-02-09 Thread Duncan Murdoch
On 09/02/2010 4:50 AM, g.russ...@eos-solutions.com wrote: Full_Name: George Russell Version: 2.10.0 and 2.11.0 Under development (unstable) (2010-02-08 r51108) OS: Windows Submission from: (NULL) (217.111.3.131) c(a,b)[[c(TRUE,FALSE)]] Error in `[[.default`(factor(c(a, b)), c(TRUE, FALSE)) :

Re: [Rd] Confusing error message for [[.factor (PR#14209)

2010-02-09 Thread Uwe Ligges
On 09.02.2010 10:50, g.russ...@eos-solutions.com wrote: Full_Name: George Russell Version: 2.10.0 and 2.11.0 Under development (unstable) (2010-02-08 r51108) OS: Windows Submission from: (NULL) (217.111.3.131) c(a,b)[[c(TRUE,FALSE)]] Error in `[[.default`(factor(c(a, b)), c(TRUE, FALSE)) :

[Rd] cbind(deparse.level=2,...) problems

2010-02-09 Thread William Dunlap
Should the deparse.level=2 argument to cbind and rbind be abandoned? It is minimally documented, not used in any CRAN package, and causes some problems. E.g., (a) If a matrix input has row names but not column names cbind(deparse.level=2,...) stops.

Re: [Rd] cbind(deparse.level=2,...) problems

2010-02-09 Thread Peter Dalgaard
William Dunlap wrote: Should the deparse.level=2 argument to cbind and rbind be abandoned? It is minimally documented, not used in any CRAN package, and causes some problems. Bill, This code has been touched by Brian quite recently. Try again with a current r-devel checkout. (Specifically,

Re: [Rd] cbind(deparse.level=2,...) problems

2010-02-09 Thread William Dunlap
-Original Message- From: Peter Dalgaard [mailto:p.dalga...@biostat.ku.dk] Sent: Tuesday, February 09, 2010 10:56 AM To: William Dunlap Cc: r-devel@r-project.org Subject: Re: [Rd] cbind(deparse.level=2,...) problems William Dunlap wrote: Should the deparse.level=2 argument to

[Rd] Aggregate dataframe variables, return more than 2 vars

2010-02-09 Thread violet lock
Hello r-devel, I have data.frame with 3 columns and I would like to group by 1 column(id), find the max of the third column (date) and return the data for that max date value along with the id and the value in the second column. Example: dat - data.frame(id = rep(1:3, 3), date =