From ripley at stats.ox.ac.uk  Sun Oct 10 18:20:59 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sun Oct 10 18:21:06 2004
Subject: [Rd] strange behaviour in R 2.0.0 (PR#7275)
In-Reply-To: <20041010155306.73761EDE3@slim.kubism.ku.dk>
Message-ID: <Pine.LNX.4.44.0410101701320.29146-100000@gannet.stats>

This is the fourth bug report today from Xiao Gang FAN, and we have had no
response to replies to the first three.  Please do not send bug reports 
unless you are prepared to take responsibility for them and answer 
requests for further information.

Please read the posting guide and the FAQ and use a meaningful subject 
line.

Now, where is the requested code to reproduce PR#7272?


On Sun, 10 Oct 2004 xiao.gang.fan1@libertysurf.fr wrote:

> Full_Name: Xiao Gang FAN
> Version: R 2.0.0
> OS: Windows
> Submission from: (NULL) (82.226.247.142)
> 
> 
> The following codes worked for R 1.9.1
> 
> > a = data.frame(x=1:2)
> > a$y = strptime(c("20010101","20020101"),"%Y%m%d")
> 
> this no longer works for R 2.0.0:
> 
> Error in "$<-.data.frame"(`*tmp*`, "y", value = list(sec = c(0, 0), min = c(0, 
> : 
>         replacement has 9 rows, data has 2

That code is indeed incorrect, and did fail in 1.9.1:

R : Copyright 2004, The R Foundation for Statistical Computing
Version 1.9.1  (2004-06-21), ISBN 3-900051-00-3

> a = data.frame(x=1:2)
> a$y = strptime(c("20010101","20020101"),"%Y%m%d")
Error in "$<-.data.frame"(`*tmp*`, "y", value = strptime(c("20010101",  :
        replacement has 9 rows, data has 2

It even failed in 1.8.0.  It `worked' in 1.7.0, but did not do what you
most likely wanted it to do (see the NEWS for 1.8.0).  You cannot sensibly
add "POSIXlt" objects to a data frame: you can add "POSIXct" objects.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] strange behaviour in R 2.0.0 (PR#7275)
Prof Brian Ripley