similar to: subsetting a list of matrices

Displaying 20 results from an estimated 2000 matches similar to: "subsetting a list of matrices"

2011 May 17
4
subsetting a list of dataframes
Hello All, I have a list of dataframes, and I need to subset it by keeping only those dataframes in the list that meet a certain criterion. Specifically, I need to generate a second list which only includes those dataframes whose number of rows is > 1. Could someone suggest how to do this? I have come close to what I need with loops and such, but there must be a less clumsy way... Many
2010 Nov 15
2
rotate column names in large matrix
Dear List, I have a large (1600*1600) matrix generated with symnum, that I am using to eyeball the structure of a dataset. I have abbreviated the column names with the abbr.colnames option. One way to get an even more compact view of the matrix would be to display the column names rotated by 90 degrees. Any pointers on how to do this would be most useful. Any other tips for displaying the
2011 Oct 03
1
function recode within sapply
Dear List, I am using function recode, from package car, within sapply, as follows: L3 <- LETTERS[1:3] (d <- data.frame(cbind(x = 1, y = 1:10), fac1 = sample(L3, 10, replace=TRUE), fac2 = sample(L3, 10, replace=TRUE), fac3 = sample(L3, 10, replace=TRUE))) str(d) d[, c("fac1", "fac2")] <- sapply(d[, c("fac1", "fac2")], recode, "c('A',
2010 Nov 11
1
exploratory analysis of large categorical datasets
Dear List, I am looking to perform exploratory analyses of two (relatively) large datasets of categorical data. The first one is a binary 80x100 matrix, in the form: matrix(sample(c(0,1),25,replace=TRUE), nrow = 5, ncol=5, dimnames = list(c( "group1", "group2","group3", "group4","group5"), c("V.1", "V.2", "V.3",
2010 Nov 19
1
negative axis values in image() and scalebar in cor.plot() {psych}
Dear List, I sent a related message yesterday, but did not receive it through the mailing list; on the R-help archives it reads as "An embedded and charset-unspecified text was scrubbed...". So here it is again, with the (little) progress I have made since then. Any help would be greatly appreciated! I am working with a relatively large correlation matrix (~1600*1600), which I am
2010 Nov 24
1
diverting output from nested loops
Dear List, I have a series of nested loops with the structure shown below, and I am struggling to figure out how to divert output to folders created with dir.create() within the loops. What I need is for the output to end up as topNameK/subNameL/objNameM.pdf; what I get instead is a series of directories topNameK/, directories subNameL/, and files objNameM.pdf, all in the working directory. Any
2009 Aug 27
1
generating multiple sequences in subsets of data
I'm running into a problem I can't seem to find a solution for. I'm attempting to add sequences into an existing data set based on subsets of the data. I've done this using a for loop with a small subset of data, but attempting the same process using real data (200k rows) is taking way too long. Here is some sample data and my ultimate goal >
2011 Jun 05
2
kronecker sum
Dear All, Could someone please suggest how to find the Kronecker sum of two 2x2 matrices, i.e. given two matrices: -A A a -a and -B B b -b I need: -A-B A B 0 a -a-B 0 B b 0 -A-b A 0 b a -a-b Many thanks, Lara [[alternative HTML version deleted]]
2008 Dec 16
2
converting a data-frame by a defined rule
Hi, I have a data frame with several columns. Now I want to transfer the data into a new variable (also a data frame), but I only want a part of the data, defined by a rule ... for example; I have following data frame: row1 row2 row3 x 2 3 x 1 4 y 5 3 y 2 3 I know want a data frame, only with lines containing x in row1. I know how to do that for one row (f <-
2012 Feb 28
2
from data.frame to Venn diagram
Hello All, I have a data.frame with this structure: m <- matrix(sample(c(rep('yes', 10, replace = TRUE), rep('no', 10, replace = TRUE), NA), 500, replace = TRUE), nrow = 100, ncol = 5) colnames(m) <- colnames(m, do.NULL = FALSE, prefix = "col") m <- as.data.frame(m) I need to generate a Venn diagram from this data.frame, displaying the various intersections of
2007 Nov 12
1
update matrix with subset of it where only row names match
I guess this has a simple solution: I have matrix 'mat1' which has row and column names, e.g.: A B C row1 0 0 0 row2 0 0 0 .... rown 0 0 0 I have a another matrix 'mat2', essentially a subset of 'mat1' where the rownames are all in 'mat1' e.g.: B row3 5 row8 6 row54 7 I want to insert the values of matrix mat2 for column B (in reality it could be some or
2008 Sep 04
1
restricted bootstrap
Hello List, I am not sure that I have the correct terminology here (restricted bootstrap) which may be hampering my archive searches. I have quite a large spatially autocorrelated data set. I have xy coordinates and the corresponding pairwise distance matrix (metres) for each row. I would like to randomly sample some number of rows but restricting samples such that the distance between them is
2013 May 01
1
Combine multiple tables into one
Hi, May be this helps: dat1<- as.data.frame(table1) ?dat2<- as.data.frame(table2) names(dat2)<-c("V3","V4") library(plyr) res<-join(dat1,dat2,type="full") ?res[is.na(res)]<- 0 ?res #? V1 V2 V3 V4 #1? 1? 1? 0? 0 #2? 1? 2? 0? 0 #3? 0? 0? 0? 1 #4? 0? 0? 0? 4 ?combinedtable<-as.matrix(res) ?colnames(combinedtable)<- NULL ?combinedtable #???? [,1] [,2]
2009 Mar 05
3
Dropping rows conditionally
Dear R-help team, I am getting addicted to using R but keep on getting many challenges on the way especially on data management (data cleaning). I have been wanting to drop all the rows if there values are `NA' or have specific values like 1 or 2 or 3. mdat <- matrix(1:21, nrow = 7, ncol=3, byrow=TRUE, dimnames = list(c("row1",
2010 Sep 06
1
Creating named.list from two matrix columns
Hi Friends, I am new to R. On R utility class pages, creating "named.list" is described with this command : new("named.list",a=1,b=2) For large matrix having two columns, such as : "row1" 2334 "row2" 347 "row3" 379 ... I want to create a named.list like : $row1 [1] 2334 $row2 [1] 347 ... Can anyone explain how "named.list"
2014 Sep 26
2
[LLVMdev] Canonicalizing vector masking.
Hi, I received an internal test case from a game team (it wasn't about this in particular), and I was wondering if there was maybe an opportunity to canonicalize a particular code pattern: %inputi = bitcast <4 x float> %input to <4 x i32> %row0i = and <4 x i32> %inputi, <i32 -1, i32 0, i32 0, i32 0> %row0 = bitcast <4 x i32> %row0i to <4 x float>
2009 Dec 02
2
Help: barchart() {Lattice}
Hi R Users, I'm using following data/code (data is attached also) to produce a stacked barplot. # Sample Data: Names Col1 Col2 Col3 Row1 -20 40 -10 Row2 30 -20 40 Row3 30 10 -20 Row4 20 20 -10 # R Code: dta<-read.table("data.txt", header=TRUE, row.names="Names") barchart(data.matrix(dta), horizontal=FALSE, stack=TRUE, par.settings = simpleTheme(col =
2009 Dec 02
1
barchart() {Lattice} -- auto.key()
Hi R Users, I'm using following data/code (data is also attached) to produce a stacked barplot. *I need help with changing legend boxes, currently I'm using "rectangles=TRUE". Is it possible to get small squares instead -- may be with a small gap between colored squares.* Currently there is no gap between the colored rectangles. # Sample Data: Names Col1 Col2 Col3 Row1 -20 40
2009 Nov 26
3
barchart() {Lattice} help.
Hi R Users, I'm trying to plot a stacked barplot. Here is data: Sample Col1 Col2 Col3 Row1 -2 4 -1 Row2 3 -2 4 Row3 3 5 -2 Row4 4 1 -1 I'm using following R code: library(lattice) dta<-read.table("data.txt", header=TRUE, row.names="Sample") barchart(data.matrix(dta), horizontal=FALSE, stack=TRUE, col=2:4,
2011 Jan 14
4
test
Hi, i have that table Thesis Day A B C 1 0 83.43 90.15 22.97 1 0 85.50 94.97 16.62 1 0 83.36 95.38 20.70 1 0 84.47 92.16 23.58 1 0 83.98 95.33 19.39 1 0 82.86 93.78 24.55 1 0 83.39 92.67 19.56 1 0 85.17 95.24 17.95 1 0 81.62 93.32 28.49 1 0 82.99 92.85 19.73 1 0 81.11 95.67 27.20 1 0 83.39 94.69 16.51 1 0 79.56 89.87 30.39 1 0 80.54 93.32 21.76 1 0 82.11 92.58 22.17 1 14 85.65 94.00 19.19 1 14