Subject:Re: [R] Fwd: rarefy a matrix of counts
Two things to note:
(1) rep() can be vectorized:
rep(1:3, 2:4)
[1] 1 1 2 2 2 3 3 3 3
(2) you will likely get much better performance if you work with
integers and convert to strings after sampling (or use factors), e.g
[EMAIL PROTECTED],
r-help@stat.math.ethz.ch
Subject:Re: [R] Fwd: rarefy a matrix of counts
Two things to note:
(1) rep() can be vectorized:
rep(1:3, 2:4)
[1] 1 1 2 2 2 3 3 3 3
(2) you will likely get much better performance if you work with
integers and convert
:Fwd: [R] rarefy a matrix of counts
-- Forwarded message --
From: Brian Frappier [EMAIL PROTECTED]
Date: Oct 11, 2006 10:10 AM
Subject: Re: [R] rarefy a matrix of counts
To: r-help@stat.math.ethz.ch
Hi Petr,
Thanks for your response. I have data that looks like
:Wed, 11 Oct 2006 10:11:33 -0400
From: Brian Frappier [EMAIL PROTECTED]
To: Petr Pikal [EMAIL PROTECTED]
Subject: Fwd: [R] rarefy a matrix of counts
-- Forwarded message --
From: Brian Frappier [EMAIL PROTECTED]
Date: Oct 11, 2006
: Fwd: [R] rarefy a matrix of counts
-- Forwarded message --
From: Brian Frappier [EMAIL PROTECTED]
Date: Oct 11, 2006 10:10 AM
Subject: Re: [R] rarefy a matrix of counts
To: r-help@stat.math.ethz.ch
Hi Petr,
Thanks for your response. I have data that looks like
:Wed, 11 Oct 2006 10:11:33 -0400
From: Brian Frappier [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
To: Petr Pikal [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
Subject: Fwd: [R] rarefy a matrix of counts
]
To: Petr Pikal [EMAIL PROTECTED]
Subject: Fwd: [R] rarefy a matrix of counts
-- Forwarded message --
From: Brian Frappier [EMAIL PROTECTED]
Date: Oct 11, 2006 10:10 AM
Subject: Re: [R] rarefy a matrix of counts
To: r-help@stat.math.ethz.ch
Hi Petr
:33 -0400
From: Brian Frappier [EMAIL PROTECTED]
To: Petr Pikal [EMAIL PROTECTED]
Subject: Fwd: [R] rarefy a matrix of counts
-- Forwarded message --
From: Brian Frappier [EMAIL PROTECTED]
Date: Oct 11, 2006