Oops, forgot to give a subject
-Original Message-
From: arnaud Gaboury [mailto:arnaud.gabo...@gmail.com]
Sent: Wednesday, May 26, 2010 2:31 PM
To: r-help@r-project.org
Cc: 'arnaud Gaboury'
Subject:
Dear group,
Here is my data frame:
dput(u)
structure(list(DESCRIPTION =
Arnaud,
check the vector :
u$POSITION0
[1] TRUE TRUE ...
what I do is putting u$POSITION==0
[1] FALSE FALSE ...
when you apply the sum() function on that vector, FALSE becomes 0 and TRUE
becomes 1. So this actually gives you a way of counting the amount of
positions that are not zero. if you
Joris,
I want to add a line in a function with a print warning if one element of
the column is 0.
I could use if(sum(u$POSITION)0) as a condition, but I can imagine having
one element equal to -2, and another one to 2. So in this case, sum=0, but
the condition is false in fact (minimum of one
3 matches
Mail list logo