RowSel <-c(0,1,0,1,2,3,0,5,5)
set.seed(24)
DF<- as.data.frame(matrix(sample(1:40,45,replace=TRUE),ncol=5))
RowSel[!as.logical(RowSel)]<-NA
DF[RowSel,]
# V1 V2 V3 V4 V5
#NA NA NA NA NA NA
#1 12 11 21 24 30
#NA.1 NA NA NA NA NA
#1.1 12 11 21 24 30
#2 9 25 6 26 26
#3 29 15 4 2 28
#
On Jun 8, 2013, at 4:09 AM, Bert Jacobs wrote:
> Hi,
>
> I have a vector that looks like this:
> RowSel <-c(0,1,0,1,2,3,0,5,5)
>
> Now I want to select rows from a specific dataframe DF based on that vector
> like this:
> SubDF <- DF[RowSel,]
>
> So this works fine, but I was wondering how I c
On 13-06-08 7:09 AM, Bert Jacobs wrote:
Hi,
I have a vector that looks like this:
RowSel <-c(0,1,0,1,2,3,0,5,5)
Now I want to select rows from a specific dataframe DF based on that vector
like this:
SubDF <- DF[RowSel,]
So this works fine, but I was wondering how I could add blank rows add the
3 matches
Mail list logo