Skip to content

Compute counts and statistics of occurrence of events in sequences that meets a criterion.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

rfsaldanha/nseq

Repository files navigation

nseq

R-CMD-check CRAN status

Compute the number of sequences of values in a vector that meets conditions of length and magnitude.

Installation

You can install the stable release from CRAN.

install.packages("nseq")
library(nseq)

Or install the development version of from GitHub:

# install.packages("remotes")
remotes::install_github("rfsaldanha/nseq")
library(nseq)

Example

On this vector, how many sequences of values present at least 3 consecutive observations with values equal or greater than 5?

library(nseq)

vec <- c(8,15,20,8,1,7,8,0,-2,5,9,12,0,-1,4,2,3,1)

trle_cond(vec, a_op = "gte", a = 3, b_op = "gte", b = 5)
#> [1] 2

And how many sequences of values have exactly 3 consecutive observations with values equal or greater than 5?

trle_cond(vec, a_op = "e", a = 3, b_op = "gte", b = 5)
#> [1] 1

About

Compute counts and statistics of occurrence of events in sequences that meets a criterion.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages