similar to: Rd files with "%" (was: permuting dimensions)

Displaying 20 results from an estimated 2000 matches similar to: "Rd files with "%" (was: permuting dimensions)"

2004 Sep 13
1
do.call("dim<-" , ... )
OK guys another problem. I have a 3D array "x" with dim(x)=c(a,a,b^2) and I want to rearrange the elements of x to make a matrix "y" with dimensions c(a*b,a*b). Neither a nor b is known in advance. I want the "n-th" a*a submatrix of y to be x[,,n] (where 1 <= n <= b^2). Needless to say, this has gotta be vectorized! Toy example with a=2, b=3 follows:
2004 Nov 18
3
Errors checking a library
Hi I am writing an R library. The documentation for one of my functions includes an example that I *know* works - simply cut and paste into R on either Windows and Linux and it works perfectly, no errors or warnings, nothing, nyet. However, when I run "R CMD check" on the library, I get an error. I am running R CMD check on linux, and the offending piece of code appears to be:
2004 Mar 10
3
aperm() and as.list() args to "["
Hi everyone. I'm playing with aperm(): a <- 1:24 dim(a) <- c(2,3,2,2) permutation <- c(1,2,4,3) b <- aperm(a,permutation) So if my understanding is right, a[1,3,2,1] == b[c(1,3,2,1)[permutation] ] but this isn't what I want because the RHS evaluates to a vector, and I am trying to identify a single element of b. How do I modify the RHS to give what I want? Following
1999 Jul 20
2
tensor() function and sets
Hi Everyone, To complete the outer() and kronecker() functions in the base, may I suggest the following tensor() function, which allows the multiplication of arrays through sets of conformable dimensions. I am happy to write a help page if required. The code also needs a setdiff() function which prompts me to ask: what about simple set functions? I expect many of us have written our own
2010 Dec 27
1
aperm() should retain class of input object
aperm() was designed for multidimensional arrays, but is also useful for table objects, particularly with the lattice, vcd and vcdExtra packages. But aperm() was designed and implemented before other related object classes were conceived, and I propose a small tune-up to make it more generally useful. The problem is that aperm() always returns an object of class 'array', which
2010 Jul 29
1
Using 'dimname names' in aperm() and apply()
I think that the "dimname names" of tables and arrays could make aperm() and apply() (and probably some other functions) easier to use. (dimname names are, for example, created by table() ) The use would be something like: -- x <-table( from=sample(3,100,rep=T), to=sample(5,100,rep=T)) trans <- x / apply(x,"from",sum) y <- aperm( trans,
2000 Jun 13
1
problem with aperm? (PR#568)
R version 1.0.1 OS RedHat Linux 6.1 In attempting to test for numeric vectors in a data frame, I tried: apply(dataframe,2,is.numeric) and found that it returned FALSE for all vectors whether they were numeric or not. I tracked this to the fact that as.array() was converting the data frame to character vectors, and thought I could solve it by using array(), which preserved the mode of the
2010 Apr 18
3
xtabs() of proportions, and naming a dimension (not a row)
Hi, xtabs() creates a table of counts. I want a table of proportions -- that is, I want to divide every vector (along a particular dimension) by its sum. The tiny example below does that. The call to xtabs() creates a matrix "A" with dimensions ("x1","x2","y"). I transform "A" using aperm() and aaply() to get the matrix "B". The
2004 Sep 07
3
Run up to R 2.0.0 for package maintainers
The major changes for R 2.0.0 are now in place, and we have provided a set of notes for package maintainers at http://developer.r-project.org/200update.txt on both changes needed and new opportunities. The main thing which needs to be done is to revise the DESCRIPTION file, in particular to ensure the Depends: field is accurate. We do run daily checks over all the CRAN packages. See
2004 Sep 09
2
Rd syntax error detected in CRAN daily checks
Please forgive me if you already received this. I had an e-mail sending glitch this morning. http://cran.r-project.org/src/contrib/checkSummary.html reported an error in Design.trans.Rd * checking Rd files ... ERROR Rd files with syntax errors: /var/mnt/hda3/R.check/r-devel/PKGS/Design/man/Design.trans.Rd: unterminated section 'alias' The .Rd file is attached. It begins
2017 Sep 28
2
building random matrices from vectors of random parameters
Sure -- thanks -- only took me 3-4 attempts to get aperm to work (as opposed to really thinking hard about how it works ;-) On 9/28/2017 11:55 AM, Duncan Murdoch wrote: > On 28/09/2017 9:10 AM, Evan Cooch wrote: >> Thanks for both the mapply and array approaches! However, although >> intended to generate the same result, they don't: >> >> # mapply approach
2006 Jun 09
1
Idempotent apply
Dear all, I have been working on an idempotent version of apply, such that applying a function f(x) = x (ie. force) returns the same array (or a permutation of it depending on the order of the margins): a <- array(1:27, c(2,3,4)) all.equal(a, iapply(a, 1, force)) all.equal(a, iapply(a, 1:2, force)) all.equal(a, iapply(a, 1:3, force)) all.equal(aperm(a, c(2,1,3)), iapply(a, 2, force))
2017 Sep 28
0
building random matrices from vectors of random parameters
The use of aperm is unnecessary if you call array() properly. ms <- array(c(rep(0, 5),so,sa*m,sa), c(5, 2, 2)) -- Sent from my phone. Please excuse my brevity. On September 28, 2017 9:10:26 AM PDT, Evan Cooch <evan.cooch at gmail.com> wrote: >Sure -- thanks -- only took me 3-4 attempts to get aperm to work (as >opposed to really thinking hard about how it works ;-) > >On
2002 Jan 30
1
mosaicplot(formula, data)--- bugged?
I have been tinkering with mosaicplot() and friends as a way of learning R. As part of this, I've written a pair.table() method for mosaic matrices, and would like to extend mosaicplot to work with loglin and logln (MASS) objects. I'm using R 1.4.0 on Win 98. I've been trying to figure out the formula interface, and think there's a bug, but not sure how to find it, yet alone fix
2004 Jul 06
1
Download Info
Maybe somebody can help me with the following questions: I have submitted Rmetrics to the CRAN server and was looking what happened. 1) The */contrib/checkSummary.html shows a table which reports the daily package check results. For my packages there is no entry in the column "r-devel", the other packages have "OK" or "WARN". What does it mean? 2) The link to
2012 Jan 08
1
Difference across the Nth dimension of an array
I have a multidimensional array - in this case with 4 dimensions of x,y,z and time. I'd like to take the time derivative of this matrix, i.e. perform the diff operator along dimension number 4. In Matlab, there is a simple option to specify which dimension the difference is to be taken across., but I can't see this in R. I realise I can use aperm to rotate my array so that time is in
2017 Sep 28
3
building random matrices from vectors of random parameters
Thanks for both the mapply and array approaches! However, although intended to generate the same result, they don't: # mapply approach n = 3 sa <- rnorm(n,0.8,0.1) so <- rnorm(n,0.5,0.1) m <- rnorm(n,1.2,0.1) mats = mapply(function(sa1, so1, m1) matrix(c(0,sa1*m1,so1,sa1),2,2,byrow=T), sa, so, m, SIMPLIFY = FALSE) print(mats) [[1]] ????????? [,1]????? [,2] [1,] 0.0000000
2007 Apr 12
1
Milestone: 1000 packages on CRAN as of today(?)
Hi, I was just looking at the "CRAN Daily Package Check Results" [http://cran.r-project.org/src/contrib/checkSummary.html], and realized there are 1000 packages on CRAN as of today (look at row 3 in the table below). Yet another quite extraordinary milestone in R history. Last updated on 2007-04-12 11:48:32 Results for installing and checking packages using the three current flavors
2009 Apr 01
2
Matrix multiplication - code problem
Hi listers, I am having some trouble in a matrix multiplication... I have already checked some posts, but I didn't find my problem... I have the following code... But I am not getting the right multiplication... I checked the dimension and they are fine... id_y <- array(1:10,dim=c(2,1,5)) id_yt<-aperm(id_y,c(2,1,3)) m_id<-array(dim=c(dim(id_y)[1],dim(id_y)[1],dim(id_y)[3])) for (i in
2017 Sep 28
0
building random matrices from vectors of random parameters
On 28/09/2017 9:10 AM, Evan Cooch wrote: > Thanks for both the mapply and array approaches! However, although > intended to generate the same result, they don't: > > # mapply approach > > n = 3 > sa <- rnorm(n,0.8,0.1) > so <- rnorm(n,0.5,0.1) > m <- rnorm(n,1.2,0.1) > mats = mapply(function(sa1, so1, m1) > matrix(c(0,sa1*m1,so1,sa1),2,2,byrow=T),