Re: [Rd] fix() changes the class of mts objects

From: Simone Giannerini <sgiannerini_at_gmail.com>
Date: Wed, 09 May 2007 16:42:45 +0200

My concern here is that users can be confused from the fact that if one has a single time series fix() uses the default method of edit() and does not change
its class

> x <- ts(1:5)
> fix(x)
> class(x)
[1] "ts"

whereas for mts objects edit.data.frame is used so that in my opinion it might be worth to clarify it in the documentation.

Regards

Simone

On 5/9/07, Prof Brian Ripley <ripley_at_stats.ox.ac.uk> wrote:
>
> Why did you expect otherwise?: fix() is treating it as matrix and
> ?edit.matrix says that it only works on 'simple data frames' (and converts
> matrices to such).
>
> Editing R objects can easily change aspects of them, as dput() is not
> faithful, environments can get lost and so on.
>
> On Wed, 9 May 2007, Simone Giannerini wrote:
>
> > Dear all,
> >
> > it looks like fix() changes the class of mts objects, here is a
> reproducible
> > example (tested both on WinXP and Linux):
> >
> >> x <- ts(cbind(1:5,1:5))
> >> x
> > Time Series:
> > Start = 1
> > End = 5
> > Frequency = 1
> > Series 1 Series 2
> > 1 1 1
> > 2 2 2
> > 3 3 3
> > 4 4 4
> > 5 5 5
> >> class(x)
> > [1] "mts" "ts"
> >> edit(x)
> > Series 1 Series 2
> > [1,] 1 1
> > [2,] 2 2
> > [3,] 3 3
> > [4,] 4 4
> > [5,] 5 5
> >> class(x)
> > [1] "mts" "ts"
> >> fix(x)
> >> class(x)
> > [1] "matrix"
> >> x
> > Series 1 Series 2
> > [1,] 1 1
> > [2,] 2 2
> > [3,] 3 3
> > [4,] 4 4
> > [5,] 5 5
> >
> >> R.version
> > _
> > platform i386-pc-mingw32
> > arch i386
> > os mingw32
> > system i386, mingw32
> > status
> > major 2
> > minor 5.0
> > year 2007
> > month 04
> > day 23
> > svn rev 41293
> > language R
> > version.string R version 2.5.0 (2007-04-23)
> >
> >> R.version
> > platform x86_64-unknown-linux-gnu
> > arch x86_64
> > os linux-gnu
> > system x86_64, linux-gnu
> > status
> > major 2
> > minor 5.0
> > year 2007
> > month 04
> > day 23
> > svn rev 41293
> > language R
> > version.string R version 2.5.0 (2007-04-23)
> >
> > ______________________________________________________
> >
> > Simone Giannerini
> > Dipartimento di Scienze Statistiche "Paolo Fortunati"
> > Universita' di Bologna
> > Via delle belle arti 41 - 40126 Bologna, ITALY
> > Tel: +39 051 2098262 Fax: +39 051 232153
> > ______________________________________________________
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-devel_at_r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
> --
> Brian D. Ripley, ripley_at_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
>

-- 
______________________________________________________

Simone Giannerini
Dipartimento di Scienze Statistiche "Paolo Fortunati"
Universita' di Bologna
Via delle belle arti 41 - 40126  Bologna,  ITALY
Tel: +39 051 2098262  Fax: +39 051 232153
______________________________________________________

	[[alternative HTML version deleted]]

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed 09 May 2007 - 14:59:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 09 May 2007 - 16:33:45 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.