Displaying 20 results from an estimated 11000 matches similar to: "Randomly shuffle an array 1000 times"
2010 Oct 18
1
Randomly shuffle an array multiple times
Dear List,
I have a table i have read into R:
Name Yes/No
John 0
Frank 1
Ann 0
James 1
Alex 1
etc - 800 different times.
What i want to do is shuffle yes/no and randomly re-assign them to the name.
I have used sample() and permute(), however there is no way to do this 1000 times. Furthermore, i want to copy the data into a excel spreadsheet in the same order as the data was input so i can
2003 Nov 10
10
shuffling a vector
Hi,
I'me trying to write a function that will shuffle a vector. At the
moment I'm baically making a vector of randomized indices and then
making a new vector from the original one using these random indices.
However, is there an alternative (more elegant) method to do this? I
tried help.search('shuffle') but it does'nt return anything relevant.
Thanks,
2009 Sep 01
1
permutation and reshuffling
Hi,
I'm looking for an efficient code that will enable me to reshuffle data
(phenotype) for certain number of individuals and creating a loop that will
randomly simulate it for 10000 times *(permutation)*. I also need to find
how I keep the information (p value for each SNP) gathered for all the 10000
iterations.
My data set looks like this (n=500):
Individual #
Phenotype
SNP1
SNP2
2011 Jun 20
2
Error of Cross Validation
Dear R users:
Recently, I tried to write a program to calculate cross-validated predicted
value.
My sources are as follows. However, the R reported an error.
Could you please check the sources? Thanks.
set.seed(100)
x<-rnorm(100)
y<-sample(rep(0:1,50),replace=T)
dat<-data.frame(x,y)
library(rms)
fito<-lrm(y~x)
preo<-predict(fito)
pre<-matrix(NA,nrow=100,ncol=200)
for (i in
2008 Dec 08
2
Permutation exact test to compare related series
I all,
is there a way with R to perform an exact permutation test to replace the
wilcoxon test to compare paired series and/or to perform pairwise multiple
comparisons for related series after a Friedman test ?
Thanks
Gilles
2011 Nov 02
4
array manipulation
Hello,
I'm at the very beginning of the learning process of this language.
Sorry in advance for the (possible but plausible) stupidity of my question.
I would like to find a way to permute the DIMENSIONS of an array.
Something that sounds like the function "permute()" in matlab.
Given an array C of dimensions c x d x T , for instance, the command
permute(C, [2 1 3])
would provide
2009 Apr 26
3
3 questions regarding matrix copy/shuffle/compares
Hello all,
I have the following function call to create a matrix of POP_SIZE rows
and fill it with bit strings of size LEN:
pop=create_pop_2(POP_SIZE, LEN)
I have 3 questions:
(1) If I did
keep_pop[1:POP_SIZE] == pop[1:POP_SIZE]
to keep a copy of the original data structure before manipulating
'pop' potentially, would this make a deep copy or just shallow? Ie
2011 May 06
1
(no subject)
I'm using the survey api. I am taking 1000 samples of size of 100 and
replacing 20 of those values with missing values. Im trying to use
sequential hot deck imputation, and thus I am trying to figure out how
to replace missing values with the value before it. Other things I have
to keep in mind is if there are two missing values side by side, how do I
replace both those values with the
2011 Aug 10
1
Reading XML files masquerading as XL files
R version 2.13.1
OS X (or Windows)
Colleagues,
I received a number of files with a .xls extension. These files open in XL and, by all appearances, are XL files. However, it appears to me that the files are actually XML:
> readLines(dir()[16])[1:10]
[1] "<?xml version=\"1.0\"?>"
[2] "<Workbook
2008 Apr 09
3
permutation/randomization
Hello,
I have what I suspect might be an easy problem but I am new to R and
stumped. I have a data set that looks something like this
b<-c(2,3,4,5,6,7,8,9)
x<-c(2,3,4,5,6,7,8,9)
y<-c(9,8,7,6,5,4,3,2)
z<-c(9,8,7,6,1,2,3,4)
data<-cbind(x,y,z)
row.names(data)<-c('a','b','c','d','e','f','g','h')
which gives:
x y z
2011 Jan 28
5
Mean from confidence intervals
Dear List,
I am not sure if A) this is possible or B) the correct place to ask.
I am looking to find the mean - i have n, and the two-tailed confidence intervals 0.95 & 0.25 with a p-value of 0.05.
Can i find the mean from this data ?
Thanks
Peter
2011 Nov 18
1
cca with repeated measures
Dear all,
How can I run a constrained correspondence analysis with
the following data:
15 animals were measured repeatedly month-wise (over to 2 years)
according to ther diet composition (8 food categories).
our data.frame looks like this:
food 1 2 ... 8 sex season year animal
freq 12 8 ... 1 0 summer 2011 1
freq 0 7 ... 0 1 winter 2011 1
...
freq 0 7 ... 0 1 spring 2011 15
We
2010 Jan 28
2
Constrained vector permutation
Hello,
I'm trying to permute a vector of positive integers > 0 with the constraint
that each element must be <= twice the element before it (i.e. for some
vector x, x[i] <= 2*x[i-1]), assuming the "0th" element is 1. Hence the
first element of the vector must always be 1 or 2 (by assuming the "0th"
element is 1). Similarly, the 2nd must always be below/= 4, the
2018 Mar 06
0
Heap Exhaustion during 'DAGCombiner::Run'
Martin:
It sounds like you are doing is more akin to shuffle selection than fusion
and therefore it's a better fit for instruction selection than
DAGCombining. Try movign it to <Target>ISelDAGToDAG's Select (or
potentially PreprocessISelDAG).
Th
-Nirav
On Tue, Mar 6, 2018 at 4:05 PM Martin J. O'Riordan <MartinO at theheart.ie>
wrote:
> We discovered what is
2011 Feb 10
3
Permuting rows of a matrix
Hi,
I need to permute the rows of a matrix, where each row is independently rearranged. A simple solution is this:
shuffled <- datamatrix <- matrix(1:24, ncol = 4)
for (i in 1:nrow(datamatrix)) { shuffled[i, ] <- sample(datamatrix[i, ]) }
> datamatrix
[,1] [,2] [,3] [,4]
[1,] 1 7 13 19
[2,] 2 8 14 20
[3,] 3 9 15 21
[4,] 4 10 16 22
[5,]
2012 Jun 09
2
Help with permutation function from Turner et al. 2010 (Ecology)
Hello,
I'm using R code that includes a residual permutation that was written as a supplement to the paper:
Turner et al. 2010. A general hypothesis-testing framework for stable isotopes ratios in ecological studies. Ecology 91:2227-2233.
The supplemental code is available at: http://www.esapubs.org/archive/ecol/E091/157/suppl-1.htm
When I execute the function, no warnings are given
2003 Feb 07
1
a question regarding s-plus libraries and R
Hi!
I am a relatively new user of R and I use it to prepare my dissertation. I
have come to some very usefull and specific libraries written for S-PLUS 4
and would like to use them in R. Is that possible? I just found out that one
of these libraries has already been transfered to R, while 3 others have
not. For the matter of beeing more exact I''m interested in the dealing with
missing
2018 Mar 06
2
Heap Exhaustion during 'DAGCombiner::Run'
We discovered what is happening.
SDAGCombiner essentially looks at various combinations of nodes to do with vectors, and when it can, it creates a vector shuffle. The problem is, that our vector shuffle lowering builds new trees with vector element, or vector sub-vector insert sequences. The generic DAGCombiner, reconstructs these into a new shuffle, and so the loop continues - we reduce it,
2004 Aug 06
2
[PATCH] Make SSE Run Time option.
> Please note that dot products of simple vector floats are usually
> faster
> in the scalar units. The add across and transfer to scalar is just too
> expensive.
Or do four at once, with some shuffling (which is basically free);
almost the same code as a 4x4 matrix/vector multiply.
<p>Segher
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage:
2011 Jul 09
1
PERMANOVA+ and adonis in vegan package
Hi,
I was wondering if someone can tell me what is the difference between
"strata" argument (function "adonis" in "vegan" package) and
using random effects in PERMANOVA+ add-on package to PRIMER6 when doing
permutational MANOVA-s? Is the way permutations are done the same?
Thank you very much in advance,
Vesna
--
View this message in context: