File: testClass.R

package info (click to toggle)
r-bioc-biobase 2.24.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,288 kB
  • ctags: 64
  • sloc: ansic: 711; makefile: 5; sh: 3
file content (29 lines) | stat: -rw-r--r-- 516 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#some simple test classes to see if things are working at all

library(methods)

setClass("foo", representation(a="numeric", b="numeric"))

setClass("bar", representation(c="numeric", b="character"))

setClass("baz", "foo", representation(d="list", e="logical"))


#load up Biobase so we can test

library(Biobase)

f1 <- new("foo", a=10,b=15)
l1 <- list(a=f1)

nc1 <- new("container", x=l1, content="foo", locked=FALSE)

b1 <- new("bar", b="AAA", c=10)

#this should fail...

 nc1[[1]] <- b1

 nc1[[1]]

 v<-nc1[1]