Dear all,
I am using RDA to study plant communities in various land uses (variable LU
with values M, U, etc.). For each land use, I sample 3 to 5 fields (M1, M2, U1,
U2, etc). I make 5 measurements for both plant communities and environmental
variables in each field.
I repeat the process every
You may get a reply here, but this post belongs on a statistics list
like stats.stackexchange.com, not r-help, which is concerned about R
programming issues rather than statistical methodology.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and s
Friends,
Matched pairs studies are well documented, but what happens if we were to alter
the manner in which events were paired to one another. Say we change the order
of our data and pair without replacement, so that event 1 may pair with event
23 in one instance, but also event 36 or 102 in
As I believe I've said to you before, please cc the list in your replies.
And as Ted said:
So, Gyanendra, what *exactly* is the question? Then it would perhaps
be possible to locate the source of the error message. Or, if the
question was indeed as I originally assumed it to be, what was the
expr
You are correct, Michael! I had (rashly) assumed that Gyanendra's
error message was the result of asking for the factorial of a
number which was too large, without checking it against the limits.
I then embarked on a discussion of large-nymber problems in R as
relevant to his type of query.
My fin
What build of R can't calculate factorial(150)? I thought the max
double of a 32 bit build would be on the order of 10^308 ~ 2^1024 (the
material below seems to agree with me on this)
But yes, agreed with Ted: it's very helpful to think a bit about what
you are calculating when doing these sorts o
On 18-Nov-11 16:03:44, Gyanendra Pokharel wrote:
> Hi all,
> why factorial(150) shows the error out of range in 'gammafn'?
> I have to calculate the number of subset formed by 150 samples
> taking 10 at a time. How is this possible?
> best
Because factorial(150) is nearly 10^263, which is far grea
On Fri, 2011-11-18 at 11:03 -0500, Gyanendra Pokharel wrote:
> Hi all,
> why factorial(150) shows the error out of range in 'gammafn'?
> I have to calculate the number of subset formed by 150 samples taking 10 at
> a time. How is this possible?
> best
Do you mean:
> choose(150, 10)
[1] 1.169554e+
Hi all,
why factorial(150) shows the error out of range in 'gammafn'?
I have to calculate the number of subset formed by 150 samples taking 10 at
a time. How is this possible?
best
[[alternative HTML version deleted]]
__
R-help@r-project.org mai
So I've been puzzling on this for a week or so and don't see any
elegant way to do it. I'd imagine there's a nifty way to do it using
ddply() in conjunction with some melt() tools to get it all in one
data frame (or just possibly mapply() after converting the "iN"
factors to characters to make sure
Michael Weylandt wrote:
>
> I'm not entirely sure how these two objects are related. Perhaps give a
> little more information on the transform and we can help with
> implementation...
>
Ok, I have got 2 matrices [P,I] and [I,E].
testcontents [P,I]:
structure(list(P = structure(c(1L, 1L, 1L, 2L
I'm not entirely sure how these two objects are related. Perhaps give a
little more information on the transform and we can help with
implementation...
For now checkout expand.grid() library(gtools)
Michael Weylandt
On Thu, Sep 29, 2011 at 8:25 AM, Metronome123 wrote:
> Hi,
>
> I have got this
Hi,
I have got this start situation:
structure(list(subject = structure(c(1L, 1L, 1L, 1L, 1L, 1L,
2L, 2L, 2L, 2L, 2L), .Label = c("s1", "s2"), class = "factor"),
part = structure(c(1L, 1L, 2L, 3L, 4L, 5L, 1L, 1L, 2L, 6L,
6L), .Label = c("p1", "p2", "p3", "p4", "p5", "p9"), class = "fac
thematics; r-help@r-project.org
> Subject: Re: [R] permutations from vectors out of a matrix
>
> Meyners,Michael,LAUSANNE,AppliedMathematics schrieb:
> > Sorry, wrong button. Below a hopefully more helpful solution...
> >
> > Etienne,
> > I don't see the p
Etienne Stockhausen
Sent: Montag, 18. Januar 2010 19:20
To: r-help@r-project.org
Subject: [R] permutations from vectors out of a matrix
Dear R-Users,
I'm relativley new to R and have the following problem. I
need all permutations of the vectors created by the collumns
of a matrix. I
Januar 2010 19:20
> To: r-help@r-project.org
> Subject: [R] permutations from vectors out of a matrix
>
> Dear R-Users,
> I'm relativley new to R and have the following problem. I
> need all permutations of the vectors created by the collumns
> of a matrix. I w
f Of Etienne Stockhausen
> Sent: Montag, 18. Januar 2010 19:20
> To: r-help@r-project.org
> Subject: [R] permutations from vectors out of a matrix
>
> Dear R-Users,
> I'm relativley new to R and have the following problem. I
> need all permutations of the vectors created b
Dear R-Users,
I'm relativley new to R and have the following problem. I need all
permutations of the vectors created by the collumns of a matrix. I will
give a small example:
p=3
n=2^p-1
#number of obtainable vect
Hi Eiger,
Here a suggestion to get the output in the format you want:
# Package, data and path
require(combinat)
x <- do.call(rbind,permn(c(23,46,70,71,89)))
f <- "C:/permutations.txt"
# Original output
write.table(x, f, col.names = F, row.names = F)
# Transposed output
write.table(t(x), "C:/tra
jholtman wrote:
>
> try this to get the column output:
>
> cat(x, sep='\n', file='/tempxx.txt')
>
>
Thanks for your answer.
I've tried the command "cat" , but give me this error:
> x<-permn(c(2,3,5,7))
> cat(x, file="/my_path/filename.txt","\n")
Error in cat(list(...), file, sep, fill, la
try this to get the column output:
cat(x, sep='\n', file='/tempxx.txt')
For the transposed out, do:
write.table(t(x), file="filename.txt", row.names=F, col.names=F)
On Sat, Oct 10, 2009 at 2:09 PM, Eiger wrote:
>
> Hi, I have a question about "how" write output in a .txt file.
>
> With tihs co
Hi, I have a question about "how" write output in a .txt file.
With tihs command, I write permutations of the numbers (1,2,3) in a .txt
file:
> x<-permn(c(1,2,3))
> write.table(x, file="filename.txt", row.names=F, col.names=F)
This is output in filename.txt:
1 1 3 3 2 2
2 3 1 2 3 1
3 2 2 1 1 3
Dirk Eddelbuettel wrote:
>
> Supply an argument 'lib' pointing to a directory where you write to, or
> alternatively (but not generally recommended) run R as root to install the
> package as root can write to /usr/lib/R/lib.
>
> Dirk
>
OK! I've installed this package.
Thank you!
:)
Example:
Eiger wrote:
>
>
> When I try to install the "combinat" package, it give me these errors:
> _
>
> Error in utils::install.packages(l[s + 1]) : unable to install packages
> _
>
> Wha
On 10 October 2009 at 08:15, Eiger wrote:
| require(combinat)
| permn((c(23,46,70,71,89))
|
| Thanks.
| When I try to install the "combinat" package, it give me these errors:
| _
| --- Please select a CRAN mirror for use in this session ---
require(combinat)
permn((c(23,46,70,71,89))
Thanks.
When I try to install the "combinat" package, it give me these errors:
_
--- Please select a CRAN mirror for use in this session ---
Warning in utils::install.packages(l[s + 1]) :
argume
require(combinat)
permn((c(23,46,70,71,89))
On Oct 10, 2009, at 10:05 AM, Eiger wrote:
Question 1.
I would calculate all the permutations of numbers (23,46,70,71,89)
How can I write correctly the code?
(Load gregmisc)
permutations (..?...)
__
Question 2.
It's possible
Question 1.
I would calculate all the permutations of numbers (23,46,70,71,89)
How can I write correctly the code?
(Load gregmisc)
> permutations (..?...)
__
Question 2.
It's possible permute a string?
..for example:
EIGER
EGIER
EREGI
etc..etc..
Thanks,
E.
--
View this mes
alf Of
> Stavros Macrakis
> Sent: Tuesday, March 17, 2009 10:46 PM
> To: Greg Snow
> Cc: onyourmark; r-help@r-project.org
> Subject: Re: [R] permutations in R
>
> On Tue, Mar 17, 2009 at 12:41 PM, Greg Snow
> wrote:
> > No, I meant the Combinations package, it is ap
Stavros Macrakis wrote:
> On Tue, Mar 17, 2009 at 5:24 AM, Gavin Simpson
> wrote:
>
>> On Mon, 2009-03-16 at 18:43 -0400, Stavros Macrakis wrote:
>>
>>> ... no way to find relevant functions, and no way of knowing which one to
>>> use if there is more than one.
>>>
>
>
>> That
On Tue, Mar 17, 2009 at 12:41 PM, Greg Snow wrote:
> No, I meant the Combinations package, it is apparently an Omegahat package
> (http://www.omegahat.org/Combinations/). It looks similar to the permn
> function as far as the usage goes, but the documentation includes additional
> information
On Tue, Mar 17, 2009 at 5:24 AM, Gavin Simpson wrote:
> On Mon, 2009-03-16 at 18:43 -0400, Stavros Macrakis wrote:
>> ... no way to find relevant functions, and no way of knowing which one to
>> use if there is more than one.
> That is what the Task Views are meant to address, for discrete subje
ject.org
> Subject: Re: [R] permutations in R
>
> Greg,
>
> Thanks for helping this user.
>
> I assume you mean the permn function in the combinat package? For a
> new user (including me), it is not obvious how to get from "the
> permutations function in the Combina
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> >> project.org] On Behalf Of onyourmark
> >> Sent: Friday, March 13, 2009 7:09 PM
> >> To: r-help@r-project.org
> >> Subject: [R] permutations in R
> >>
> >>
> >>
ct.org] On Behalf Of onyourmark
Sent: Friday, March 13, 2009 7:09 PM
To: r-help@r-project.org
Subject: [R] permutations in R
Hi. Does anyone know of a function which will take as input a
number n
(or a
set of n letters) and will give out, one at a time, the
permutations of
n
(or of those n l
n 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 onyourmark
>> Sent: Friday, March 13, 2009 7:09 PM
>> To: r-help@r-project.org
>>
ermountain 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 onyourmark
> Sent: Friday, March 13, 2009 7:09 PM
> To: r-help@r-project.org
> Subject: [R] permutations
Try this:
> # Taken from combinations(gtools)
> # library(gregmisc)
> # Function permutations
> fn_perm_list <-
+ function (n, r, v = 1:n)
+ {
+if (r == 1)
+ matrix(v, n, 1)
+else if (n == 1)
+ matrix(v, 1, r)
+else {
+ X <- NULL
+ for (i in 1:n) X <- rbind(X, c
Hi. Does anyone know of a function which will take as input a number n (or a
set of n letters) and will give out, one at a time, the permutations of n
(or of those n letters) as a vector?
So that I can use the permutations one at a time. And such that it will
exhaust all the permutations with no r
I have 200 samples, with 1 million data points in each. Each data
point can have a value from zero to 10, and we can assume that they're
normally distributed. If I calculate a sum by drawing one random data
point from each sample and adding them, what value does that sum need
to be before I can say
mat, file="C:/Documents and Settings/My
> Documents/permutations.txt",sep=";",col.names=FALSE, row.names=FALSE)
>
> HTH,
>
> Thierry
> Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Namens Elke Moons
> Verzonden: dinsdag 13 mei 2008 9:49
> Aan: r-h
IL PROTECTED] [mailto:[EMAIL PROTECTED]
Namens Elke Moons
Verzonden: dinsdag 13 mei 2008 9:49
Aan: r-help@r-project.org
Onderwerp: [R] Permutations
Dear R-users,
Is there an easy way to determine all possible vectors of length 21 with
each entry having permutations from 0 to 4, instead of doing it l
Dear R-users,
Is there an easy way to determine all possible vectors of length 21 with
each entry having permutations from 0 to 4, instead of doing it like this?
It really takes up too much time, and I am convinced that there exists
something easier.
Can you help me? Thank you in advance!
Is this you want?
apply(apply(perms, 1, as.logical), 2, function(x)df[x])
On 14/01/2008, Serguei Kaniovski <[EMAIL PROTECTED]> wrote:
> Henrique, I know I have to use "apply", but how do I select the columns of
> the dataframe using the permutation vectors produced by
>
> nvar <- ncol(dat) - 1
If I understand your question use apply
?apply
On 14/01/2008, Serguei Kaniovski <[EMAIL PROTECTED]> wrote:
> Hallo All,
>
> I would like to apply a function to all permutations of variables in a
> dataframe (except the first). What is the best way to achieve this?
>
> I produce the permutations u
Hallo All,
I would like to apply a function to all permutations of variables in a
dataframe (except the first). What is the best way to achieve this?
I produce the permutations using:
nvar <- ncol(dat) - 1
perms <- as.matrix( expand.grid(rep( list(1:0) , nvar ))[ , nvar:1] )
Thanks in advance
On Tue, 2 Oct 2007, Paul Johnson wrote:
Jérôme,
As a first attempt, how about the function below. It works (or not) by
randomly sorting the rows and columns, then searching the table for
"squares" with the corners = matrix(c(1,0,0,1),ncol=2) and subtracting them
from 1 to give matrix(c(0,1,1,0)
Jérôme,
As a first attempt, how about the function below. It works (or not) by
randomly sorting the rows and columns, then searching the table for
"squares" with the corners = matrix(c(1,0,0,1),ncol=2) and subtracting them
from 1 to give matrix(c(0,1,1,0),ncol=2) (and vice versa). Randomized
matri
48 matches
Mail list logo