Displaying 2 results from an estimated 2 matches for "riskengineer".
2013 Mar 26
2
Feed rle() output to hist()
I want to make a histogram from the lengths vector which is part of the
output of rle. But I don't know how to access that vector so that I use it
as an argument of hist(). What argument must I use so that I use the
lengths vector as an input to hist()?
Example output is:
Run Length Encoding
lengths: int [1:4] 1 2 3 3
values : num [1:4] -1 1 -1 1
A printout of the function rle() may
2013 Mar 25
1
Newbie code to count runs of up or down moves
There are probably many mistakes with this code. I am used to coding in C
with a debugger, so I am very new to coding in R without one and different
syntax. My code in the upper left panel of R Studio
isz<-c(3,1,4,5,2,1,0,3,5,8)zlength(z)y<-c(0,0,0,0,0,0,0,0,0,0)ylength(y)zdiff
= diff(z)zdiffn<-length(zdiff)nx<-zdifff<-function(x) {
for (k in 1:n){