File: rstats.R

package info (click to toggle)
raschsampler 0.8-6-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 320 kB
  • ctags: 15
  • sloc: f90: 400; makefile: 2
file content (25 lines) | stat: -rwxr-xr-x 781 bytes parent folder | download | duplicates (10)
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
"rstats" <-
function(RSobj,userfunc,...)
{
    obj.name <- deparse(substitute(RSobj))
    if (!(class(RSobj)=="RSmpl" || class(RSobj)=="RSmplext")){
         err.text<-paste(obj.name," is not a sample object - see help(\"rsextrobj\")",sep ="",collapse="")
         stop(err.text)
    }

    # extracts simulated matrices into three dimensional array sim
    n_tot  <- RSobj$n_tot
    n      <- RSobj$n
    k      <- RSobj$k
    nwords <- c(trunc((k+31)/32))

    # store coded simulated matrices in list with n_eff+1 elements
    sim<-split(RSobj$outvec,gl(n_tot,n*nwords))


    # decode simulated matrices and apply user function
    #RET<-unlist(lapply(sim,rsunpack,n,k,nwords,userfunc))
    RET<-lapply(sim,rsunpack,n,k,nwords,userfunc,...)
    RET
}