Hi
r-help-boun...@r-project.org napsal dne 12.03.2010 00:20:39:
On 12/03/2010, at 11:25 AM, Jim Bouldin wrote:
I continue to have great frustrations with NA values--in particular
making
summary calculations on rows or cols of a matrix containing them.
For
example, why
I continue to have great frustrations with NA values--in particular making
summary calculations on rows or cols of a matrix containing them. For
example, why does:
a = matrix(1:30,nrow=5)
is.na(a[c(1:2),c(3:4)]);a
[,1] [,2] [,3] [,4] [,5] [,6]
[1,]16 NA NA 21 26
[2,]2
Healthcare
greg.s...@imail.org
801.408.8111
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
project.org] On Behalf Of Jim Bouldin
Sent: Thursday, March 11, 2010 3:26 PM
To: R help
Subject: [R] NAs and row/column calculations
I continue to have
On 12/03/2010, at 11:25 AM, Jim Bouldin wrote:
I continue to have great frustrations with NA values--in particular making
summary calculations on rows or cols of a matrix containing them. For
example, why does:
a = matrix(1:30,nrow=5)
is.na(a[c(1:2),c(3:4)]);a
[,1] [,2] [,3] [,4]
On 12/03/2010, at 11:25 AM, Jim Bouldin wrote:
I continue to have great frustrations with NA values--in particular
making
summary calculations on rows or cols of a matrix containing them. For
example, why does:
a = matrix(1:30,nrow=5)
is.na(a[c(1:2),c(3:4)]);a
[,1]
Jim,
The next step for understanding what happens is to subset a complicated
expression
and see what its sub-pieces are doing.
Since
apply(a[!is.na(a)],2,sum)
doesn't work, start by looking at each of the arguments to apply.
You already verified that
!is.na(a)
gives what you want. Now take
On Mar 11, 2010, at 6:20 PM, Jim Bouldin wrote:
On 12/03/2010, at 11:25 AM, Jim Bouldin wrote:
I continue to have great frustrations with NA values--in particular
making
summary calculations on rows or cols of a matrix containing them.
For
example, why does:
a =
On Mar 11, 2010, at 11:28 PM, David Winsemius wrote:
On Mar 11, 2010, at 6:20 PM, Jim Bouldin wrote:
On 12/03/2010, at 11:25 AM, Jim Bouldin wrote:
I continue to have great frustrations with NA values--in particular
making
summary calculations on rows or cols of a matrix containing
8 matches
Mail list logo