elementslope | R Documentation |
'Slope' of elements within a sequence according to position in sequence
elementslope(s, type = "linear", target = "A")
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 |
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")
numeric of length 1
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.