maechler@stat.math.ethz.ch
2002-Nov-20 16:16 UTC
[Rd] log( <ts object> ) is not <ts object> (PR#2315)
As I have found, taking functions like log(.) on a "ts" object returns something that still has the "ts" class attribute but is not a properly classed R object anymore. E.g. (lt <- log(as.ts(1:7))) clearly calls print.default instead of print.ts and the analogue for plot(lt) or also diff(lt) returns a "ts" object but with invalid start/end. (this is also a test of the R-bugs@R-project.org address) Martin Maechler <maechler@stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <><
ripley@stats.ox.ac.uk
2002-Nov-20 17:16 UTC
[Rd] log( <ts object> ) is not <ts object> (PR#2315)
For the record, only if coercion is involved (as here, since 1:7 is integer). It applies to lots of arithmetic functions, not just log. Fixed in both R-patched and R-devel. On Wed, 20 Nov 2002 maechler@stat.math.ethz.ch wrote:> As I have found, taking functions like log(.) on a "ts" object > returns something that still has the "ts" class attribute but is > not a properly classed R object anymore. > > E.g. > (lt <- log(as.ts(1:7))) > > clearly calls print.default instead of print.ts > and the analogue for plot(lt) > or also > diff(lt) > > returns a "ts" object but with invalid start/end. > > (this is also a test of the R-bugs@R-project.org address) > > Martin Maechler <maechler@stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ > Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 > ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND > phone: x-41-1-632-3408 fax: ...-1228 <>< > > ______________________________________________ > R-devel@stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-devel >-- 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595