dear R users
 
 I am having a problem with the output of diff for a numeric vector
 which has the values (2,4,6,7), one expects to get 2 2 1 but I am
 getting 4 6 7, here is the setup.
 
 
 info <- with(rle(x),
      data.frame(value = values,
                 start = cumsum(lengths)-lengths+1,
                 end = cumsum(lengths)
                 )[lengths > 1,]
      );
 > x <- c(3,4,4,4,4,5,7,7,0,1,1,2,2,2);
 > info
   value start end
 2     4     2   5
 4     7     7   8
 6     1    10  11
 7     2    12  14
 
 #since I cann't get the first column of info, I cast
 info into a matrix
 > m <- as.matrix(info); 
 > diff(m[,0])
 
 4
 6
 7
 
 any idea why this is happening? and how to get the 
 correct diff.
 
 
 thank you
			
---------------------------------

	[[alternative HTML version deleted]]

