[Rd] creating a '[' method for an S4 class

From: Benilton Carvalho <beniltoncarvalho_at_gmail.com>
Date: Sat, 07 Jul 2012 03:49:34 +0100


Hi,

I'm working on an S4 class that is expected to behave like an array.

I have some difficulties when defining '[' and I wonder if someone could point me to the right direction:

  1. Call the S4 object "obj"
  2. Assume dim(obj) = c(10, 4, 2)
  3. Suppose someone calls: obj[1:3,] , which is a mistake, given dim(obj); how do I detect such situations?

Thank you very much for your attention and time, benilton



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 07 Jul 2012 - 02:59:04 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Sat 07 Jul 2012 - 12:30:30 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.

list of date sections of archive