Skip to content
Back to formatted view

Raw Message

Message-ID: <200401311643.16719.ozric@web.de>
Date: 2004-01-31T15:43:16Z
From: Christian Schulz
Subject: in which column is an entry?

Hi,

df  is a data.frame with 43 colums and 29877 rows with lot of NA.
I want the column number for all respondendts in one column 
where is the first entry >=0 as columnnumber.

my first step:
 time <- function(df)
+     {        for (i in 1:length(df [,1])) {    
+     which(df[i,1]:df[i,43] >= 0)
+     }
+            }

> 
> t1 <-  time(YS)
Error in df[i, 1]:df[i, 43] : NA/NaN argument

Many thanks for help , regards christian