Dear all,
 
on my Windows XP R 2.4.0 version with Package its version 1.1.4 I have a 
problem with
str() applied on an its-object after a simple matrix manipulation on the its 
object (see below).
I am not sure, whether this a problem with my application, its or str().
 
Of course, one can make
> str(core(its(mat)) / 1)
 num [1:2, 1:3] 1 2 3 4 5 6
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:2] "2003-01-01" "2003-01-04"
  ..$ : chr [1:3] "a" "b" "c"

But its object should be able to handle simple matrix multiplications, even if 
the result is a matrix.
Any help is greatly appreciated.
 
Many thanks in advance,
Stefan
 
> mat <- 
> structure(1:6,dim=c(2,3),dimnames=list(c("2003-01-01","2003-01-04"),letters[1:3]))
> its(mat)
An object of class "its"
           a b c
2003-01-01 1 3 5
2003-01-04 2 4 6
Slot "dates":
[1] "2003-01-01 Westeuropäische Normalzeit" "2003-01-04 Westeuropäische 
Normalzeit"
 
> str(its(mat))
Formal class 'its' [package "its"] with 2 slots
  ..@ .Data: int [1:2, 1:3] 1 2 3 4 5 6
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr [1:2] "2003-01-01" "2003-01-04"
  .. .. ..$ : chr [1:3] "a" "b" "c"
  ..@ dates:'POSIXct', format: chr [1:2] "2003-01-01" "2003-01-04"

> str(its(mat) / 1)
Error in ob[!is.na(ob)] : (subscript) logical subscript too long

> str(its(mat / 1))
Formal class 'its' [package "its"] with 2 slots
  ..@ .Data: num [1:2, 1:3] 1 2 3 4 5 6
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr [1:2] "2003-01-01" "2003-01-04"
  .. .. ..$ : chr [1:3] "a" "b" "c"
  ..@ dates:'POSIXct', format: chr [1:2] "2003-01-01" "2003-01-04"

> class(its(mat / 1))
[1] "its"
attr(,"package")
[1] "its"
 
____________________________________
Dr. Stefan Albrecht, CFA
Allianz Private Equity Partners GmbH 
Giselastr. 4 | 80802 Munich | Germany

Phone: +49.(0)89.3800.18317 
Fax: +49.(0)89.3800.818317 
EMail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  
Web: www.apep.com <http://www.apep.com/> 


Please note my new email address: 
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 

 

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to