ACroske yahoo.com> writes:
>
>
> Ben:
> Thanks for the reply. One further question, and this is where my novice
> status at R shows through. The code makes sense, but what would I put it for
> "m"? Is it the same number for all three (that was my first thought since it
> was the same placeholde
Yes I do want a random assignment, instead of rounding. (From what I
understand of the rbinom command, it will randomly assign 1 or 0, and the
higher the given probability, the higher the likelihood of a 1... Feel free
to correct me if I'm wrong!)
Ben Bolker wrote:
>
> -BEGIN PGP SIGNED ME
Ben:
Thanks for the reply. One further question, and this is where my novice
status at R shows through. The code makes sense, but what would I put it for
"m"? Is it the same number for all three (that was my first thought since it
was the same placeholder for all three). Number of rows in the matr
On Wednesday 09 July 2008, Ben Bolker wrote:
> Dylan Beaudette wrote:
> | On Wednesday 09 July 2008, Ben Bolker wrote:
> |> ACroske yahoo.com> writes:
> |>> I have a large matrix full of probabilities; I would like to convert
>
> each
>
> |>> probability to a 1 or a 0 using rbinom.
> |>> How can I
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dylan Beaudette wrote:
| On Wednesday 09 July 2008, Ben Bolker wrote:
|> ACroske yahoo.com> writes:
|>> I have a large matrix full of probabilities; I would like to convert
each
|>> probability to a 1 or a 0 using rbinom.
|>> How can I do this on the
On Wednesday 09 July 2008, Ben Bolker wrote:
> ACroske yahoo.com> writes:
> > I have a large matrix full of probabilities; I would like to convert each
> > probability to a 1 or a 0 using rbinom.
> > How can I do this on the entire matrix? The matrix was converted from a
> > raster ArcMap dataset,
Is this what you're looking for?
test <- matrix(runif(100, 0, 1), nrow = 20)
nr <- nrow(test)
matrix(sapply(test, rbinom, n = 1, size = 1), nrow = nr)
ACroske wrote:
I have a large matrix full of probabilities; I would like to convert each
probability to a 1 or a 0 using rbinom.
How can I do th
ACroske yahoo.com> writes:
>
>
> I have a large matrix full of probabilities; I would like to convert each
> probability to a 1 or a 0 using rbinom.
> How can I do this on the entire matrix? The matrix was converted from a
> raster ArcMap dataset, so the matrix is essentially a map. Because of
I have a large matrix full of probabilities; I would like to convert each
probability to a 1 or a 0 using rbinom.
How can I do this on the entire matrix? The matrix was converted from a
raster ArcMap dataset, so the matrix is essentially a map. Because of this,
I have no column headings.
Thanks!
9 matches
Mail list logo