inst/doc/disindex.R

## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(echo = TRUE)

## -----------------------------------------------------------------------------
library("disordR")
(d <- disord(c(4,6,1,2,3,4,5,1)))
ind <- which(d>4)

## -----------------------------------------------------------------------------
d
d[ind]
d[ind] <- 99
d

## -----------------------------------------------------------------------------
ind

## -----------------------------------------------------------------------------
d <- disord(c(4,1,6,2))
dl <- sapply(d,function(x){seq(from=5,to=x)})
dl

## -----------------------------------------------------------------------------
howlong <- unlist(lapply(dl,length))
longest <- which(howlong == max(howlong))
dl[[longest]]

Try the disordR package in your browser

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

disordR documentation built on May 29, 2024, 11:06 a.m.