Learn R Programming

CNprep (version 1.0)

smedian.sample:

Usage

smedian.sample(pos, v)

Arguments

pos
v

Value

    Examples

    Run this code
    ##---- Should be DIRECTLY executable !! ----
    ##-- ==>  Define data, use random,
    ##--	or do  help(data=index)  for the standard data sets.
    
    ## The function is currently defined as
    function (pos, v) 
    {
        w <- v[pos[1]:pos[2]][!is.na(v[pos[1]:pos[2]])]
        return(median(sample(w, length(w), replace = T), na.rm = T))
      }

    Run the code above in your browser using DataLab