Hello, I have some files generated from microarray experiments. I used scan() to read the files, and assigned each file to a unique name with many rows and columns. Now I want to create a array (ArrayA) with unique names, and I can use ArrayA[1,2][[6]] to refer the data in each file. Is there any packages available for array of array? Thanks! [[alternative HTML version deleted]]
Hi, Tiandao Li wrote:> Hello, > > I have some files generated from microarray experiments. I used scan() to > read the files, and assigned each file to a unique name with many rows and > columns. Now I want to create a array (ArrayA) with unique names, and I can > use ArrayA[1,2][[6]] to refer the data in each file. Is there any packages > available for array of array? >if all of your initial arrays only consist of rows and columns (i.e. matrices) and have the same number of rows and columns, you can store it conveniently in a three dimensional array: mat1a <- matrix(1:10, ncol=2) mat2a <- matrix(11:20, ncol=2) mat1a mat2a arr3D <- array(numeric(0), dim=c(nrow(mat1a), ncol(mat1a), 2)) arr3D[,,1] <- mat1a arr3D[,,2] <- mat2a arr3D arr3D[,,2] if your initial arrays (assuming again that you have matrices) have varying amount of rows and columns, I would suggest to use lists: mat1b <- matrix(1:10, ncol=2) mat2b <- matrix(101:133, ncol=3) mat1b mat2b list3D <- list(numberone=mat1b, numbertwo=mat2b) list3D list3D[[1]] list3D[[1]] list3D[["numberone"]] list3D[["numbertwo"]] I hope this helps. Best, Roland
Hello, I have 30 GenePix tab-delimited files generated from 10 microarray experiments, each has 3 replicates. I used scan() to read the files, and assigned each file to a unique name (such as A1, A2, A3 for experment A, and B1, B2, and B3 for experiment B) with 1000 rows and 56 columns. Now I want to create a array (ArrayA) with these file names,>ArrayA[,1] [,2] ... [,10] [1,] A1 B1 C1 [2,] A2 B2 C2 [3,] A3 B3 C3 so I can use ArrayA[1,2][[6]] to refer the data in column6 of experimentB, replicate 1. Is there any packages available for array of array? Thanks!
Maybe Matching Threads
- How to send variables through AMI originate and read those variables in context?
- merging dataframes
- [LLVMdev] How to find the first block of each loop
- How to apply a function to slices of multidimensional arrays, and not just iterating through single elements
- Simple question on replace a matrix row