Assuming DF is a data frame like this:
DF <- data.frame(V1 = c(1, 0, 1, 0), V2 = c(1, 1, 1, 1),
V3 = c(0, 1, 1, 1), V4 = c(0, 0, 0, 1))
# try this:
head(rowSums((rbind(0, cummax(DF)) < rbind(cummax(DF), 0))), -1)
On Sun, Dec 21, 2008 at 8:36 PM, Keun-Hyung Choi wrote:
> Dear helpers,
>
>
Dear helpers,
I'm using R version 2.8.0.
Suppose that I have a small data set like below.
[,1] [,2] [,3] [,4]
a1100
b0110
c1110
d0111
First, I'd like to find sum of each row uniquely present in each row, but
only sequentially f
Will this do it for you:
> nrows <- 10
> ncols <- 10
> mat <- matrix(sample(0:1, nrows * ncols, TRUE), nrow=nrows, ncol=ncols)
> mat
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]101110000 0
[2,]000000011
Dear helpers,
I'm using R version 2.8.0.
Suppose that I have a small data set like below.
[,1] [,2] [,3] [,4]
a1100
b0110
c1110
d0111
First, I'd like to find row sum of values uniquely present in each row, but
only sequen
4 matches
Mail list logo