File: test-parse_transforms.3.R

package info (click to toggle)
r-cran-lambda.r 1.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 284 kB
  • sloc: sh: 9; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 427 bytes parent folder | download | duplicates (2)
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
rm(list=ls())

WishartModel(n,m,Q,sd) %as% {
  x <- list()
  x@n <- n
  x@m <- m
  x@Q <- Q
  x@sd <- sd
  x
}

WishartMatrix(x, model) %as% {
  x@n <- model@n
  x@m <- model@m
  x@Q <- model@Q
  x@sd <- model@sd
  x
}


assert('parse_transforms_3', {
  model <- WishartModel(10,20,2,1)
  mat <- WishartMatrix(rnorm(10), model)

  (attr(mat,'n') == 10)
  (attr(mat,'m') == 20)
  (attr(mat,'Q') == 2)
  (attr(mat,'sd') == 1)
})