similar to: The permutation of one vector into another

Displaying 20 results from an estimated 10000 matches similar to: "The permutation of one vector into another"

2010 Sep 03
1
'seq' help page: seq_length -> seq_len?
In the Value section of the 'seq' help page it says 'seq_along' and 'seq_length' always return an integer vector. I believe it should be 'seq_along' and 'seq_len' always return an integer vector. as there are no seq_length function? Best, Niels -- Niels Richard Hansen Web: www.math.ku.dk/~richard Associate Professor
2010 Sep 30
1
Assignment to a slot in an S4 object in a list seems to violate copy rules?
Dear R-developers I came across the following issue, which I find strange: setClass("A", representation(a = "numeric")) B <- list() myA <- new("A", a = 1) B$otherA <- myA B$otherA at a <- 2 myA at a Assigning a new value to slot 'a' in the _copy_ of myA stored in B$otherA changes the original value of myA -- this was surprising to me, and I
2011 Apr 14
2
Krylov subspace computations of matrix exponentials
I use the very nice expm functions available from the expm and Matrix packages. My understanding is that for large sparse matrices the currently best methods available are Krylov subspace methods, but they are as far as I can tell not implemented in either of the packages mentioned, nor in any other R package I have found. Does anybody know if Krylov subspace methods are available from any R
2010 Dec 11
1
'identical' and the warning "ignoring non-pairlist attributes"
Dear R developers Using the 'foreach' package I encounter warnings like Warning message: In identical(.combine, cbind) : ignoring non-pairlist attributes Warnings appear once in a new R-session when I run a particular piece of code - and not again. I understand from the source code of 'identical' that the function checks and believes that .combine and cbind have non-pairlist
2010 Aug 26
1
Passing arguments between S4 methods fails within a function:bug? example with raster package.
Dear all, This problem came up initially while debugging a function, but it seems to be a more general problem of R. I hope I'm wrong, but I can't find another explanation. Let me illustrate with the raster package. For an object "RasterLayer" (which inherits from Raster), there is a method xyValues defined with the signature
2010 Aug 26
3
Using termplot() with transformations of x
Hi all I was playing with termplot(), and came across what appears to be an inconsistency. It would appreciate if someone could enlighten me: > # First, generate some data: > y <- rnorm(100) > x <- runif(length(y),1,2) > # Now find the log of x: > logx <- log(x) > > # Now fit two models that are exactly the same, but specified differently: > m1 <-
2010 Sep 30
4
interactive session
Hi guys, My concern is to create an automated process from the beginning to the end. I want to copy all my code together in one piece and paste it to R console and sit back and relax :) except one moment in which the program should ask me to enter a number.. and only then (only after getting a valid number from me) it should continue to read and process the rest of the code. I tried lots of
2010 Nov 19
0
Error from sparse pattern matrix product
Hi The following attempt to minimize memory consumption fails. m1 <- Matrix(c(rep(1,1000), rep(0,2000)), 1500) m2 <- as(m1, "ngCMatrix") Then m1 %*% c(1,2) produces the desired matrix product, while m2 %*% c(1,2) results in the error Error in x %*% y : Cholmod error 'invalid xtype' at file:../MatrixOps/cholmod_sdmult.c, line 82 I might be making a wrong
2010 Dec 17
0
How to use the RUnit tracker in unit tests?
R-developers Does anybody know how I incorporate the use of the tracker in RUnit in the unit tests? I have read the RUnit Vignette, help pages and searched around, but I could find no examples of using 'inspect' in the unit test functions. Moreover, doing so, I tried something like library(RUnit) myFunction <- function(x) { return(x) } track <- tracker() track$init()
2011 Apr 22
1
Seeking help re: ? single apply command or an alternative
Dear R-help list, Sorry to trouble everyone. This seems like it could be achieved with a single command (? variant of apply), but I am not quite seeing it. I am trying to multiply one vector (a1 below) by corresponding values in a3 (as determined by matching element in a vector a2). The example below might be clearer. a1 <- c(4,3,4,6,8,9,2,3,4,6,7,4) a2 <-
2009 Feb 23
1
Slow indexing access for Matrix
Consider the following little "benchmark" > require(Matrix) > tmp <- Matrix(c(rep(1,1000),rep(0,9000)),ncol=1) > ind <- sample(1:10000,10000) > system.time(tmp[ind,]) user system elapsed 0.004 0.001 0.005 > ind <- sample(1:1000,10000,replace=TRUE) > system.time(tmp[ind,]) user system elapsed 0.654 0.006 0.703 >
2011 Jan 29
1
environment question: changing variables from a formula through model.frame?
Hello all, I came across a behavior of R with environments that I'm not sure what is causing it. It involves changing variables that are found through using model.frame on a formula inside a function. I wonder if it's a "bug" or a "feature". And in either case, how it might be managed. Here is a simple example: # let's say we have an x and y variables: temp_x
2011 Apr 17
5
cube root
This is some interesting: > -8^(1/3) [1] -2 > x=(-8:8) > y=x^(1/3) > y [1] NaN NaN NaN NaN NaN NaN NaN NaN 0.000000 1.000000 [11] 1.259921 1.442250 1.587401 1.709976 1.817121 1.912931 2.000000 So, can anybody explain this?! (Why is x[1]^(1/3)=y[1]=NaN, but -8^(1/3)=-2?) Thx!!! [[alternative HTML version deleted]]
2009 Feb 19
0
Meaning of .local and the special token ..1 returned from match.call
I am writing a version of the subset function for a new class. I don't understand the behavior of match.call in this particular case, and I didn't seem to be able to find much help in the language definition or the email archive. Here follows a minimal example: setClass("myClass", representation(id = "factor") )
2008 Dec 12
1
Support vector model?
Dear All, Apologies for sending this email to both list, but at this point I'm not sure which one could help me the most. I have 4 sets of data, 1 test and 3 different sets of controls. The measurements are binary, with a matrix of 0 and 1 I'm measuring across time (rows, ~815) the behaviour of organelles in the cell by microscopy in response to different stimuli (several measurements
2002 Oct 03
1
File corruption with write cache enabled - patch included
I recently found out that write caching in samba sometimes leads to file corruption (the setup program for Sophos Antivirus generates corrupted files when making a "central installation" on a Samba share). This morning I tracked down the place in the Samba code that leads to corruption. Here is what happened to me: "write cache size" is 8192 bytes. A client opens a new file
2008 Apr 15
1
sign(<permutation>) in R ?
I am looking for an algorithm (written in R (preferably) or C, but even pseudo-code in a text book maybe fine) to determine the sign of a permutation. What is that? Well, a permutation is either even or odd, the sign is +1 or -1, respectively, see, e.g., http://en.wikipedia.org/wiki/Signature_of_a_permutation which also says >> In practice, in order to determine whether a given
2011 Sep 17
2
onet.permutation()
I saw the manual of this function but not sure what to do. I have a array contain 7 numbers and want to choose 4 to do permutation test. But using this function with parameters as onet.permutation(scores,4), it returns 0. Instead, with no parameter, onet.permutation(), it returns something but every time it's different. Please tell me how am I supposed to do it. Thanks a lot -- View this
2018 May 23
0
find the permutation function of a sorting
> On May 22, 2018, at 10:57 PM, John <miaojpm at gmail.com> wrote: > > Thanks, David. > I got the answer from the web. > Is there any easy way to permute a set (e.g., a set of characters) by the permutation it returns? Thanks, > > > > x <- c(10,7,4,3,8,2) > > sort(x, index.return=TRUE) > $x > [1] 2 3 4 7 8 10 > > $ix > [1] 6 4 3 2
2018 May 23
3
find the permutation function of a sorting
Thanks, David. I got the answer from the web. Is there any easy way to permute a set (e.g., a set of characters) by the permutation it returns? Thanks, > x <- c(10,7,4,3,8,2) > sort(x, index.return=TRUE) $x [1] 2 3 4 7 8 10 $ix [1] 6 4 3 2 5 1 2018-05-23 10:49 GMT+08:00 David Winsemius <dwinsemius at comcast.net>: > > > > On May 22, 2018, at 10:06 PM, John