dear R users,
please, consider the following code you may run:
setClass("my.class1",
representation(
my.list = "list",
my.array1 = "array"),
prototype=prototype(
my.list =list(),
my.array1 =array(0,c(3,3,3))
))
#------------------
setClass("my.class2",
representation(
my.array2 = "array",
my.array3 = "array"),
prototype=prototype(
my.array2 =array(0,c(3,3,3)),
my.array3 =array(0,c(3,3,3))
))
#------------------
x <- new("my.class1")
[EMAIL PROTECTED] <- new("my.class2")
[EMAIL PROTECTED] <- new("my.class2")
Is there any method in R to trim dimensions of all the component arrays
(my.array1, my.array2, my.array3, etc.) in one time inside all the
hierarchical level of the composite object I named 'x'?
in other words, if I want to keep only the 2nd dimension, I have to do:
[EMAIL PROTECTED],2,]
[EMAIL PROTECTED]@my.array2[,2,]
[EMAIL PROTECTED]@my.array3[,2,]
[EMAIL PROTECTED]@my.array2[,2,]
[EMAIL PROTECTED]@my.array3[,2,]
etc.
thank you
--
--------------------------------------------------------
François Bastardie
French Research Institute for the Development of the Sea (IFREMER)
Ecologie et Modèles pour l'Halieutique
Rue de l'Ile d'Yeu
BP 21105
44311 NANTES Cedex 03 - France
Tél : 02 40 37 41 64
Fax : 02 40 37 40 75
E-mail : [EMAIL PROTECTED]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html