elementslope: 'Slope' of elements within a sequence according to position...

View source: R/elementslope.R

elementslopeR Documentation

'Slope' of elements within a sequence according to position in sequence

Description

'Slope' of elements within a sequence according to position in sequence

Usage

elementslope(s, type = "linear", target = "A")

Arguments

s

character of length 1 or longer, contains the sequence

type

character (linear or logistic): which type of regression to use

target

character of length 1: occurence of which element to model

Details

s can be provided via a single character, which only works if the elements are themselves only one character, for example "A" in "AAABGACCAAFW"

s can also be provided via a character vector, which will work also if the elements are themselves longer than one character, for example "Ax" in c("Ax", "B", "A", "A", "Ax", "C")

Value

numeric of length 1

Examples

S <- "AAAAABBBA"
elementslope(S, "linear", target="A")
elementslope(S, "logistic", target="A")
S <- c("A", "A", "B", "A", "A", "A")
elementslope(S, "linear")
elementslope(S, "logistic")
S <- c("Ax", "Ax", "B", "Ax", "Ax", "Ax")
elementslope(S, "linear", target = "Ax")
elementslope(S, "logistic", target = "Ax")
S <- "AAAAABBB"
elementslope(S, "linear", target="A")
elementslope(S, "logistic", target="A")
# NA because of complete separation, i.e. logistic model cannot be identified

gobbios/cfp documentation built on April 11, 2022, 2:22 a.m.