R/random.R

Defines functions random

Documented in random

random <-
function(x, na.rm=TRUE){
if(na.rm) x=x[!is.na(x)]
lenx=length(x)
if(lenx==0) return(NA)
ifelse(lenx==1, x, sample(x, 1))
}

Try the pathview package in your browser

Any scripts or data that you put into this service are public.

pathview documentation built on Dec. 12, 2020, 2 a.m.