[R] Method dispatch for print() in package its

Gabor Grothendieck ggrothendieck at gmail.com
Thu Apr 12 16:37:33 CEST 2007


Without a reproducible example I can't tell what the problem is
but as a workaround you could print it as a zoo object:

library(its)
library(zoo)

# create an its object
example(its)
ii <- its(mat, times)

# print it without using its' print
print(as.zoo(ii))

# or from the command line just
as.zoo(ii)


On 4/12/07, Albrecht, Dr. Stefan (AZ Private Equity Partner)
<stefan.albrecht at apep.com> wrote:
> Dear all,
>
> in the package its the print() method does not seem to correctly work in all circumstances:
>
>
> > selectMethod(print, "its")
> Method Definition:
>
> function (x, ...)
> {
>    print(x at .Data <mailto:x at .Data> , ...)
> }
> <environment: namespace:its>
>
> Signatures:
>        x
> target  "its"
> defined "its"
>
>
>
> > fundPME.lst[[1]]$irr
> An object of class "its"
>                 IRR  HSBC MEEM
> 2005-10-31 0.1926175 0.07802736
> Slot "dates":
> [1] "2005-10-31 Westeuropäische Normalzeit"
>
>
> > fundPME.lst[[1]]$irr at .Data
>                 IRR  HSBC MEEM
> 2005-10-31 0.1926175 0.07802736
>
>
> > print(fundPME.lst[[1]]$irr)
>                 IRR  HSBC MEEM
> 2005-10-31 0.1926175 0.07802736
>
>
> So, is it necessary to define a print.its S3 method, or what should we do?
>
> Many thanks and best regards,
> Stefan
>
> ____________________________________
> Dr. Stefan Albrecht, CFA
> Allianz Private Equity Partners GmbH
> Königinstr. 19 | 80539 Munich | Germany
>
> Phone: +49.(0)89.3800.18317
> Fax: +49.(0)89.3800.818317
> EMail: stefan.albrecht at allianz.com <mailto:stefan.albrecht at allianz.com>
> Web: www.apep.com <http://www.apep.com/>
>
>
> Allianz Private Equity Partners GmbH | Geschäftsführung: Wan Ching Ang, Karl Ralf Jung
> Sitz der Gesellschaft: München | Registergericht: München HRB 126221 | Ust-ID-Nr.: DE 813 264 786
>
>
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



More information about the R-help mailing list