Displaying 20 results from an estimated 3000 matches similar to: "rbind to array members"
2009 Oct 18
2
rbind to array members
Hi,
I would like to add rows to arbitrary tables within a 3dimensional array.
I can directly add data to an existing row of a table:
> x <- array(0,c(1,3,2))> x[,,1] <- c(1,2,3)
And I can even add a row to the table and assign to another object.
> y <- rbind(x[,,1], c(4,5,6))
and 'y' is what I want it to be:> y?? ? [,1] [,2] [,3][1,] ? ?1 ? ?2 ? 3[2,] ? ?4 ? ?5 ? 6
but
2008 Oct 28
2
abind
I am trying to combine two arrays with different dimensions into one.
For example
The first one is
1 2 3
4 5 6
The second one is
7 8
9 10
The resulted one would be like
, , 1
1 2 3
4 5 6
, , 2
7 8
9 10
I used abind to do this, but failed. Could somebody please let me
know how to do this in R? Thanks so many.
Suyan
2005 Oct 21
1
Generalised rbind/cbind
Dear list,
Is there a generalised form of rbind/cbind for combining
matrices/arrays into higher-D structures? ie. if I have:
a <- matrix(2,2,2)
b <- matrix(3,2,2)
how can I get
array(rep(c(3,2), each=4), c(2,2,2))
?
It seems like this would be the job of a generalised abind function:
abind(a,b, along=1) == rbind(a,b)
abind(a,b, along=2) == cbind(a,b)
abind(a,b, along=3)
2006 Nov 23
2
loading libraries on MPI cluster
Dear R-users,
we are using library(snow) for computation on a linux cluster with RMPI.
We have a problem with clusterEvalQ: after launching clusterEvalQ it seems
loading the required library on each node but if we type a function
belonging to the loaded package R doesn't find it.
> library(snow)
# making cluster with 3 nodes
> cl <- makeCluster(3, type = "MPI")
Loading
2011 Jun 13
1
Composing two n-dimensional arrays into one n+1-dimensional array
If I have 2 n-dimensional arrays, how do I compose them into a n+1-dimension
array?
Is there a standard R function that's something like the following, but that
gives clean errors, handles all the edge cases, etc.
abind <- function(a,b) structure( c(a,b), dim = c(dim(a), 2) )
m1 <- array(1:6,c(2,3))
m2 <- m1 + 10
abind(m1,m2)
==>
, , 1
[,1] [,2] [,3]
[1,] 1 3 5
2005 Apr 21
1
Installing packages from source code
Hi everybody,
I have trouble in installing packages from source code by following Section
5.1 in manual R-admin.pdf . I am using R 2.1.0 and Win NT.
Following the Windows toolset section in the manual, I download the tool
set package from: http://www.murdoch-sutherland.com/Rtools/tools.zip
and unzip under C:\tools
I also downloaded Perl (Windows Port) and installed it.
2011 Aug 12
1
install packages from intranet
Hi,
I'm new to R. Apologies if this is a simple query, I've searched the mailing lists and docs but can't find a solution to my problem.
I'm trying to make some packages available on our intranet. During development the 'intranet' is a webserver running on localhost.
* When I call "install.packages" I get a mesage about not being able to access 'index
2003 Oct 21
5
do.call() and aperm()
Hi everyone
I've been playing with do.call() but I'm having problems understanding it.
I have a list of "n" elements, each one of which is "d" dimensional
[actually an n-by-n-by ... by-n array]. Neither n nor d is known in
advance. I want to bind the elements together in a higher-dimensional
array.
Toy example follows with d=n=3.
f <-
2002 Mar 13
1
several bugs (PR#918) lists and matrices
### I got bit again by the same bugs I wrote about a year ago.
### The bugs are related to matrices and arrays of lists.
### 1. There is a clear inconsistency in how R handles two
### functionally equivalent statements.
### array() is able to take a list and create a matrix.
### matrix() is unable to create that matrix.
> vector("list", 2)
[[1]]
NULL
[[2]]
NULL
>
2011 Mar 07
1
Array Help
Hi,
I have two 3 D arrays. Both are of this form
array_1<- array[n,n,k]
array_2<-array[m,m,k]
Lets say n=83 and m=80
Since n>m. I would like to add rows and columns to array_2 to make them
equal. I want to keep the size of the third dimension fixed i.e.. k.
i.e.
if (nrow(array_1)>nrow(array_2))
{
array_2[m:n,m:n,]<- 10^6
}
But this doesn't work. I tried abind and rbind but
2011 Jan 20
1
syntax for a list of components from a list
I'm attempting to generalise a function that reads individual list components, in this case they are matrices, and converts them into 3 dimensional array. I can input each matrix individually, but want to do it for about 1,000 of them ...
This works
array2 <- abind(list1[[1]],list1[[2]],list1[[3]],along=3)
This doesn't
array2 <- abind(list1[[1:3]],along=3)
This doesn't either
2012 Mar 13
1
Visualising multiple response contingency tables
Dear R Help Community,
I have a question and an answer (based on reading this forum and online
research), but I though I should share both since probably there's a much
better way to go about my solution. My question is specifically about how
to best visualise multiple response contingency tables. What I mean by
'multiple response' is that the total number of responses per row of a
2008 Oct 16
1
packages in Depends field and NAMESPACES
Must packages in the Depends field of the DESCRIPTION file have
NAMESPACES? I haven't seen this explicitly indicated anywhere.
I am writing a small package and find that when I add the abind
package to the list of the Depends field, I get an error in
R CMD check of the build.
* checking package name space information ... OK
* checking package dependencies ... ERROR
Packages required but not
2009 Dec 17
2
Problem with spliting a dataframe values
Hi all,
Hi this is kiran
I am facing a problem to split a dataframe
that is..
i have a string like: "a,b,c|1,2,3|4,5,6|7,8,8"
first I have to split with respect to "|"
I did it with command
unlist(strsplit("a,b,c|1,2,3|4,5,6|7,8,8", "\\,"))
after getting that set i made it as a dataframe and it comes like
a,b,c
1,2,3
4,5,6
7,8,8
now i have to
2009 Sep 03
5
abind, but on lists?
I'm trying to massage some data from Matlab into R. The matlab file
has a "struct array" which when imported into R using the R.matlab
package, becomes an R list with 3+ dimensions, the first of which
corresponds to the structure fields, with corresponding row names, and
the second and third+ dimensions correspond to the dimensions of the
original struct array (as matlab
2006 Sep 01
2
Local library under Windoze.
Continuing to try to customize my environment for using R under
Windoze, I experimented with installing a package from CRAN in a
local library ``Lib''.
I created the directory ``Lib'' in the folder in which R starts,
and then executed
> install.packages("abind",lib="Lib")
Everything went according to form (I got prompted to choose a mirror,
etc.) until
2005 Nov 24
2
Fwd: Matrix rotation
Ok I warned you that I'd been drinking! What I really meant was
something to go from:
[,1] [,2]
[1,] 1 2
[2,] 4 3
to
[,1] [,2]
[1,] 4 1
[2,] 3 2
to
[,1] [,2]
[1,] 3 4
[2,] 2 1
to
[,1] [,2]
[1,] 2 3
[2,] 1 4
Sorry for being a muppet, B
Begin forwarded message:
> From: Benjamin Lloyd-Hughes
2010 Apr 15
1
Poblems wih EBImage
Hello, Working with Windows 7 in a HP laptop with R-2.10.1
I download and installed ImageMagick-6.3.7.7-Q16-Windows-dll.exe and GTK 2.12.9-win32-2, then downloaded and installed from local file EBImage_3.2.0.zip and I got:
> library(EBImage)
Loading required package: abind
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared library
2006 Jul 16
2
rbind, array
B??dnie zakodowany tekst zosta? usuni?ty...
Plik: nie znany
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060716/a00859ed/attachment.pl
2004 Sep 15
4
loading error of the Rcmdr library on Debian Sid
Hello,
I just tried to get Rcmdr package working, resulting in:
----------------------------------------------------------------------
> library(Rcmdr)
Loading required package: tcltk
Loading required package: lattice
Loading required package: foreign
Loading required package: abind
Loading required package: lmtest
Loading required package: multcomp
Loading required package: relimp
Loading