Re: [Rd] 'data.frame' method for base::rep()

2011-08-02 Thread Liviu Andronic
Hello David On Tue, Aug 2, 2011 at 4:14 PM, David Winsemius wrote: >> x <- data.frame(a = as.Date('2000-01-01'), b=as.Date('2001-01-01')) >> x$d <- x$a -x$b >> require(mefa) >> rep(x, 2) >           a          b    d > 1 2000-01-01 2001-01-01 -366 > 2 2000-01-01 2001-01-01 -366 >> str(rep(x,2))

Re: [Rd] NAMESPACE problems

2011-08-02 Thread Prof Brian Ripley
On Wed, 3 Aug 2011, robin hankin wrote: Hi. I am having difficulty following section 1.6.6 of the R-extensions manual. Also in following the posting guide: which version of R is this (it matters here!)? It seems you are failing to import the functions you are attempting to take over as S4

Re: [Rd] example package for devel newcomers

2011-08-02 Thread Alexandre Aguiar
Simon, Thanx for your feedback. Em Terça 02 Agosto 2011, você escreveu: > .. also note that there is Rserve PHP client (used, e.g., by FastRWeb) > which works around a lot of the issues you encounter when you try to > embed R into PHP (initialization cost, lack of thread-safety, no > workspace se

[Rd] NAMESPACE problems

2011-08-02 Thread robin hankin
Hi. I am having difficulty following section 1.6.6 of the R-extensions manual. I am trying to update the Brobdingnag package to include a NAMESPACE file (the untb package requires the Brobdingnag package). Without the NAMESPACE file, the package passes R CMD check cleanly. However, if I include

[Rd] png() broken in R-devel

2011-08-02 Thread Hervé Pagès
Hi, Seems like this recent change broke the png() device: hpages@latitude:~/svn/R-devel/src/library/grDevices/src$ svn diff -r 56568:56569 Index: cairo/Makefile.in === --- cairo/Makefile.in (revision 56568) +++ cairo/Makefile.in

Re: [Rd] update.default: fall back on model.frame in case that the data frame is not in the parent environment

2011-08-02 Thread Duncan Murdoch
On 02/08/2011 10:48 AM, Thaler,Thorn,LAUSANNE,Applied Mathematics wrote: > mm<- function(datf) { > lm(y ~ x, data = datf) > } > mydatf<- data.frame(x = rep(1:2, 10), y = rnorm(20, rep(1:2, 10)), z = > rnorm(20)) > > l<- mm(mydatf) > update(l, . ~ . + z) # This fails, z is not found G

Re: [Rd] update.default: fall back on model.frame in case that the data frame is not in the parent environment

2011-08-02 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
> mm <- function(datf) { >lm(y ~ x, data = datf) > } > mydatf <- data.frame(x = rep(1:2, 10), y = rnorm(20, rep(1:2, 10)), z = > rnorm(20)) > > l <- mm(mydatf) > update(l, . ~ . + z) # This fails, z is not found Good point. So let me rephrase the initial problem: 1.) An lm object is fitted

Re: [Rd] example package for devel newcomers

2011-08-02 Thread Simon Urbanek
.. also note that there is Rserve PHP client (used, e.g., by FastRWeb) which works around a lot of the issues you encounter when you try to embed R into PHP (initialization cost, lack of thread-safety, no workspace separation etc.). Cheers, Simon On Aug 2, 2011, at 10:11 AM, Daniel Fuka wrote:

Re: [Rd] 'data.frame' method for base::rep()

2011-08-02 Thread David Winsemius
On Aug 2, 2011, at 7:55 AM, Liviu Andronic wrote: Dear R developers Would you consider adding a 'data.frame' method for the base::rep function? The need to replicate a df row-wise can easily arise while programming, and rep() is unable to handle such a case. See below. x <- iris[1, ] x[ rep

Re: [Rd] example package for devel newcomers

2011-08-02 Thread Daniel Fuka
Howdy again Alexandre, This sounds interesting and valuable, though might be touching some areas of R that makes me think others should chime in. I have a history of encouraging behavior that is sometimes not supported by the general public. First search does not find a project currently trying to

Re: [Rd] update.default: fall back on model.frame in case that the data frame is not in the parent environment

2011-08-02 Thread Duncan Murdoch
On 02/08/2011 9:41 AM, Duncan Murdoch wrote: It looks to me as though your proposal would allow update to remove variables, but would give erroneous results when adding them. For example: mm<- function(datf) { lm(y ~ x, data = datf) } mydatf<- data.frame(x = rep(1:2, 10), y = rnorm(20, rep(

Re: [Rd] update.default: fall back on model.frame in case that the data frame is not in the parent environment

2011-08-02 Thread Duncan Murdoch
It looks to me as though your proposal would allow update to remove variables, but would give erroneous results when adding them. For example: mm <- function(datf) { lm(y ~ x, data = datf) } mydatf <- data.frame(x = rep(1:2, 10), y = rnorm(20, rep(1:2, 10)), z = rnorm(20)) l <- mm(mydatf)

[Rd] update.default: fall back on model.frame in case that the data frame is not in the parent environment

2011-08-02 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Dear all, Suppose the following code: --8<-- mm <- function(datf) { lm(y ~ x, data = datf) } mydatf <- data.frame(x = rep(1:2, 10), y = rnorm(20, rep(1:2, 10))) l <- mm(mydatf) -->8-- If I want to update l now without providing the data argument

[Rd] 'data.frame' method for base::rep()

2011-08-02 Thread Liviu Andronic
Dear R developers Would you consider adding a 'data.frame' method for the base::rep function? The need to replicate a df row-wise can easily arise while programming, and rep() is unable to handle such a case. See below. > x <- iris[1, ] > x Sepal.Length Sepal.Width Petal.Length Petal.Width Specie

Re: [Rd] example package for devel newcomers

2011-08-02 Thread Daniel Fuka
Hi Alexandre, Is there a preferred language you would like to use in your package development? I randomly downloaded packages until I found some that helped me along my way, and might be able to help you pick one. If you are just looking at building a package of R functions and data you have devel