File: rsextrmat.R

package info (click to toggle)
r-cran-raschsampler 0.8-10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 324 kB
  • sloc: f90: 401; ansic: 15; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"rsextrmat" <-
function(RSobj, mat.no = 1)
{
    obj.name <- deparse(substitute(RSobj))
    if (!("RSmpl" %in% class(RSobj) || "RSmplext" %in% class(RSobj))){
         err.text<-paste(obj.name," is not a sample object - see help(\"rsextrobj\")",sep ="",collapse="")
         stop(err.text)
    }

    # 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)
    # }
    if(mat.no > RSobj$n_tot)
         stop("\n\tElement ",mat.no," not available (",obj.name," has ", RSobj$n_tot, " elements).")
    obj<-rsextrobj(RSobj, start = mat.no, end = mat.no)
    RET<-rstats(obj, function(x) matrix(x, nrow = obj$n))[[1]]
    RET
}