R/lpath_is_gradation.R

Defines functions lpath_is_gradation

Documented in lpath_is_gradation

### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
###
### lpath_is_gradation.R
###
### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
###
### dependencies: library(sets)
###
### 2009-04-20: created
###

lpath_is_gradation <- function(x) {

   ### check for gradation
   FUN <- function(y) {
      sd <- diff(unlist(lapply(y, function(z) length(z))), lag=1)
      all(sd <= 1)
   }
   lapply(x, FUN)

}

Try the kst package in your browser

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

kst documentation built on Oct. 24, 2022, 5:07 p.m.