On Dec 4, 2009, at 4:03 PM, Jorge Ivan Velez wrote:
Hi Austin,
What version of R are you using? It works for me for R 2.10.0
Patched on Win
XP Pro:
R> a <- matrix(c(1, 2, 3, 4), nrow = 2)
R> a
# [1] 1 3
# [2] 2 4
R> rmask <- c(TRUE, FALSE)
R> a[rmask,]
# [1] 1 3
Doesn't work on a Mac (ad
Hi Austin,
What version of R are you using? It works for me for R 2.10.0 Patched on Win
XP Pro:
R> a <- matrix(c(1, 2, 3, 4), nrow = 2)
R> a
# [1] 1 3
# [2] 2 4
R> rmask <- c(TRUE, FALSE)
R> a[rmask,]
# [1] 1 3
HTH,
Jorge
On Fri, Dec 4, 2009 at 3:52 PM, Austin Huang <> wrote:
> One problem I'
Varadhan.h
tml
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Austin Huang
Sent: Friday, December 04, 2009 3:52 PM
To: R-help@r-project.org
Subject: [R] logical maski
b <- a[rmask,,drop=FALSE]
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
> One problem I've been having is the special case in which only one
> row/column remains and the variable gets converted into a vector when
> entries are removed by logical masking. This is a problem because
> subsequent
> code may rely on matrix operations (apply, colsums, dim, etc) For example:
On Dec 4, 2009, at 3:52 PM, Austin Huang wrote:
One problem I've been having is the special case in which only one
row/column remains and the variable gets converted into a vector when
entries are removed by logical masking. This is a problem because
subsequent
code may rely on matrix operati
One problem I've been having is the special case in which only one
row/column remains and the variable gets converted into a vector when
entries are removed by logical masking. This is a problem because subsequent
code may rely on matrix operations (apply, colsums, dim, etc) For example:
> a <- ma
7 matches
Mail list logo