Re: [R] Vectors of S4 Classes

2005-12-05 Thread Matthias Kohl
Phineas schrieb:

>I have a function from which I wish to return two vectors of equal length of
>a class
>
>eg
>  
>
>>setClass("ClassOne", representation(x="numeric"))
>>
>>
>[1] "ClassOne"
>  
>
>>first<-new("ClassOne", x=1)
>>second<-new("ClassOne",x=2)
>>
>>

Do you want

list(first = first, second = second)

or something like this

setClass("ClassOneList", contains = "list")
new("ClassOneList", list(first = first, second = second))

hth
Matthias

>  
>
>>first<-rbind(first,second)
>>first
>>
>>
>
>first
>second
>
>Is it possible to create vector or list of an S4 class?
>
>Phineas
>
>  
>
>>version
>>
>>
> _
>platform i386-pc-mingw32
>arch i386
>os   mingw32
>system   i386, mingw32
>status
>major2
>minor1.0
>year 2005
>month04
>day  18
>language R
>
>__
>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
>  
>


-- 
StaMatS - Statistik + Mathematik Service
Dipl.Math.(Univ.) Matthias Kohl
Gottlieb-Keim-Straße 60
95448 Bayreuth
Phone: +49 921 50736 457
E-Mail: [EMAIL PROTECTED]
www.stamats.de

__
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


[R] Vectors of S4 Classes

2005-12-05 Thread Phineas
I have a function from which I wish to return two vectors of equal length of
a class

eg
> setClass("ClassOne", representation(x="numeric"))
[1] "ClassOne"
> first<-new("ClassOne", x=1)
> second<-new("ClassOne",x=2)
> first<-rbind(first,second)
> first

first
second

Is it possible to create vector or list of an S4 class?

Phineas

> version
 _
platform i386-pc-mingw32
arch i386
os   mingw32
system   i386, mingw32
status
major2
minor1.0
year 2005
month04
day  18
language R

__
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