similar to: permutations

Displaying 20 results from an estimated 200 matches similar to: "permutations"

2009 Sep 23
4
save txt file
Hi, I have 2 questions: Question 1: I define 2 variables: "a", "b": > a<-rbinom(4,10,0.8) output: [1] 9 7 8 8 > b<-rbinom(2,6,0.7) output: [1] 4 5 if I write: > write.table(a, file = "filename", etc. etc. .... ) it save only the values of variable "a". There is a way to save in a .txt file the values "a" and "b" as
2013 Jan 19
2
PriorityInheritance doesn't work (tinc 1.0.19)
Hello! I'd like to use PriorityInheritance option, despite it is still experimental. (Why it could be experimental, when it looks quite simple feature, no?) But this option doesn't change the TOS field of outgoing UDP packet. I just do tcpdump on outgoing interface from vty1: $ sudo tcpdump -vni eth0 udp dst port 655 And from vty2 I do ping with setting of tos field to EF(0xb8). $
2011 Dec 01
2
permutate elements in a vector
Hi all, I have a vector, e.g., A = c(10, 20, 30, 40). This 4 numbers have 4! = 24 different combination. I want to generate a matrix with one combination in one row, so the output would be B = 10 20 30 40 10 40 20 30 ... Does anyone know how to do this easily in R? Thank you very much. Wendy -- View this message in context:
2006 Jul 25
1
[RODBC] ERROR: Could not SQLExecDirect
Hi, I've got a problem with RODBC and saving (sqlSave) of a dataframe in Access. R 2.0.1 is running on windows XP. When executing the examples in R help for the "USArrests" data set "sqlSAve" works fine, but running sqlSave() for a dataframe "Adat" > str(Adat) `data.frame': 1202 obs. of 18 variables: containing 18 columns and ca. 1200 rows fails.
2010 Jan 18
2
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 will give a small example: p=3 n=2^p-1 #number of obtainable vectors mat=matrix(0,p,p) for(i in 1:p) { mat[i:1,i]=1/i } mat is now a
2006 May 08
3
Non repetitive permutations/combinations of elements
Hello all, I am trying to create a matrix of 1s and -1s without any repetitions for a specified number of columns. e.g. 1s and -1s for 3 columns can be done uniquely in 2^3 ways. -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 1 1 1 and for 4 columns in 2^4 ways and so on. I finally used the function combn([0 1],3) that I found at the following link
2008 Apr 06
3
Multiset Permutations
Dear R users, I want to perform an exact permutation of multisets. I have looked at the coin package, but it doesn't seem to offer what I am looking for. I want to perform permutations (exact - without duplications) on multisets of scalars (e.g., the multiset 0,0,1,2,2). I want to output all the possible permutations into a data frame so that each multiset permutation occupies a row (or
2006 Aug 02
2
listing of permutations
Dear R People: Suppose I have the 4 numbers: 1,2,3,4. I would like to create a listing of the permutations of 4 items taken 4 at a time. Is there a built in function for that, please? Thanks in advance! R 2-3-1 for Windows or Linux Sincerely, Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: hodgess at gator.uhd.edu
2006 Aug 18
1
Permutations with replacement
Is there a simple function or process that will create a matrix of permutations with replacement? I know that using the combinat package ###### begin R code ###### > library(combinat) > m <- t(array(unlist(permn(3)), dim = c(3, 6))) # we can get the permutations, for example 3!=6 # gives us > m [,1] [,2] [,3] [1,] 1 2 3 [2,] 1 3 2 [3,] 3 1 2 [4,]
2006 Aug 14
1
Fast way to load multiple files
Hi, Instead of having to program a loop to load several workspaces in a directory, it would be nice to store the filenames in a list "filelist" and then to apply "load" to this list "lapply( filelist, load)" Unfortunately, although it seems that R is loading the files, the contained objects are not available in the workspace afterwards. Any hints what I'm doing
2006 Jun 21
3
png() or jpeg() in a php script
Hello, I've got a problem with a PHP script, in which I call the system function (to call another processes). The call is : system("R --slave --vanilla < path/to/source/source.R"); if in this R file, I've got the lines: pdf(file="/path/to/file/file.pdf") commands dev.off() the pdf file is perfectly created but if I change the lines to:
2005 Aug 19
1
Sustainer S-1000C (Powercom protocol)
Hi, I've sent the following message 3 weeks ago, yet have recieved no reply at all. I don't want to nag, but could anyone please help me? Thanks, Dror ------------------ Hi, I have a UPS of the Israeli company Sustainer, model S-1000C (http://www.sustainer.co.il/data/files/specifications%20smart%20en.pdf - don't worry, it's in english...). I've been trying to connect to
2008 Dec 05
1
Lexical Permutation Algorithm in R
Hi all Here is a rather naive implementation of the SEPA algorithm for generating lexical permutations: lexperm3 <- function(x, n=length(x)) { perms <- list() k <- 1 perms[[k]] <- x k <- k + 1 for (y in 1:(factorial(n)-1)) { i <- n-1 while (x[i] > x[i+1] && i > 0) { i <- i - 1 } # i is largest index st x[i] > x[i+1] j <- n #
2000 Sep 26
1
Permutations
Hi, this is maybe not a real R problem but I want to solve this in R ;-) Consider the set of all permutations of 1:N (=: S, say) and a fixed element a from S. I now need to compute the number of permutations s from S which are elementwise less or equal to a: | { s \in S | s <= a } | Of cource, backtracking using a tree structure is possible. Does anyone know an efficient way? Torsten
2007 May 30
0
manova permutations and pair-wise contrasts
Hi, I have a function for doing permutation tests for Manovas, written with the help of folks here on the list. It seems to work ok, and I've found that there is indeed a significant difference among groups in my analysis. I want to follow up on this by testing for which pairs of groups are significantly different. Reasoning that since Wilks Lambda is a generalization of the Hotelling T test,
2008 Jan 14
2
Permutations of variables in a dataframe
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 Serguei Test-dataframe, comma-delimited: code,wav,w,area,gdp,def,pop,coast,milspend,agr
2010 Jun 22
1
replication time series using permutations of the each "y" values
Dear All, I'm trying to create this: I've these data (a, b,c, etc. are numbers) : 1 a b 2 c d f 3 g 4 h ... N I'm trying to create the all "time series permutations" (length = N) taking account the possibilities for each value. For example (N=4), 1 a 2 c 3 g 4 h next, 1 b 2 c 3 g 4 h next 1 a 2 d 3 g 4 h and so on. For this example, there are
2010 Jun 30
1
All possible permutations of letter A with other letters
Dear list, I have a vector of letter strings as follow: > LETTERS[c(1:7,9,15,18:25)]  [1] "A" "B" "C" "D" "E" "F" "G" "I" "O" "R" "S" "T" "U" "V" "W" "X" "Y"   I need to find sequences of length 11, which are made from  all
2017 Jun 21
0
Permutations in RDA for repeated measures, using how()
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 6 months to study the effect of time and season (D16 for dry season 2017, R16 for rainy season 2016,
2000 Dec 17
1
AW: Permutations
Niels Waller wrote: > Does anyone know of an R (or S-PLUS) function for delineating all possible > combinations and permutations? The following function delivers all permutations of 1:n. all.perm <- function(n) { p <- matrix(1, ncol = 1) for (i in 2:n) { p <- pp <- cbind(p, i) v <- c(1:i, 1:(i - 1)) for (j in 2:i) { v <- v[-1]