kadane | R Documentation |
Finds the contiguous subvector with the
largest sum among all the contiguous subvectors of v
.
kadane(v)
v |
A numeric vector |
Taken from https://tomaztsql.wordpress.com/2022/03/28/little-useless-useful-r-functions-kadanes-algorithm/
A one-row data frame with columns
Sum
- sum of the subvector's elements
Start
- starting index of the subvector
End
- ending index of the subvector
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.