search for: row3

Displaying 20 results from an estimated 31 matches for "row3".

Did you mean: row
2009 Aug 27
1
generating multiple sequences in subsets of data
...2 2 9 3 2 10 4 2 I need to derive 2 columns. I need a sequence for each unique row2, and then I need a sequence that restarts based on a cutoff value for row1 and unique row2. The following table is what is -should- look like using a cutoff of 3 for row4 row1 row2 row3 row4 1 0 1 1 1 2 1 1 2 2 3 2 1 3 3 4 3 1 4 1 5 4 1 5 2 6 5 1 6 3 7 1 2 1 1 8 2 2 2 2 9 3 2 3 1 10 4 2 4 2 I need something like row3<-sequence(nrow(uniqu...
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 <- d$row2[d$row1=="x"]). But how can I do that for all rows in one step? So that I get this for f: row1 row2 row3 x 2 3 x 1 4
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 all of column names A, B or C, etc.) (same name in both matrices if that matters - rownames of mat2 guaranteed to be in mat1) into matrix mat1 where the rownames match, so final desired res...
2009 Mar 05
3
Dropping rows conditionally
...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", "row2","row3","row4","row5","row6","row7"), c("C.1", "C.2", "C.3"))) mdat<-data.frame(mdat) mdat C.1 C.2 C.3 row1 1 2 3 row2 4 5 6 row3 7 8 9 row4 10 11 12 row5 13 14 15 ro...
2013 May 01
1
Combine multiple tables into one
...?? 4 A.K. >Hi, > ?>I am trying to combine multiple tables into one, where the elements that are created as a result of the merge to be filled with zeroes. > >In other words, to go from this: > >#Create tables to combine >row1 <- c(1,1) >row2 <- c(1,2) >row3 <- c(0,1) >row4 <- c(0,4) >table1 <- rbind(row1,row2) >table2 <- rbind(row3, row4) >table1 ?> ? ? ? ? [,1] [,2] >row1 ? ?1 ? ?1 >row2 ? ?1 ? ?2 >table2 ? >? ? ? ? [,1] [,2] >row3 ? ?0 ? ?1 >row4 ? ?0 ? ?4 > >To this: > >#What the...
2008 Sep 04
1
restricted bootstrap
...e data: main data: y<- c(1, 2, 9, 5, 6) x<-c( 1, 3, 5, 7, 9) z<-c(2, 4, 6, 8, 10) a<-c(3, 9, 6, 4 ,4) maindata<-cbind(y, x, z, a) y x x a [1,] 1 1 1 3 [2,] 2 3 3 9 [3,] 9 5 5 6 [4,] 5 7 7 4 [5,] 6 9 9 4 distance matrix: row1<-c(0, 123, 567, 89) row2<-c(98, 0, 345, 543) row3<-c(765, 90, 0, 987) row4<-c(654, 8, 99, 0) dist<-rbind(row1, row2, row3, row4) [,1] [,2] [,3] [,4] row1 0 123 567 89 row2 98 0 345 543 row3 765 90 0 987 row4 654 8 99 0 Thanks for all of the help in the past and now Cheers Grant [[alternative HTML v...
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" variable can be created by using two specified columns of a dataframe or matrix object, where one of the two columns is assigned as a name (string) and other as it...
2014 Sep 26
2
[LLVMdev] Canonicalizing vector masking.
...<4 x float> %row1i = and <4 x i32> %inputi, <i32 0, i32 -1, i32 0, i32 0> %row1 = bitcast <4 x i32> %row1i to <4 x float> %row2i = and <4 x i32> %inputi, <i32 0, i32 0, i32 -1, i32 0> %row2 = bitcast <4 x i32> %row2i to <4 x float> %row3i = and <4 x i32> %inputi, <i32 0, i32 0, i32 0, i32 -1> %row3 = bitcast <4 x i32> %row3i to <4 x float> This arises from code which expands a vector of scale factors into the diagonal of a 4x4 diagonal matrix. This code pattern is coming from intrinsics which are explicit...
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, auto.key=list(space="right", title=names(dimn...
2009 Dec 27
4
how to create a simple loop ?
I have a 5-row matrix called “data”. There are headers. it look like this : Row 1 Row2 Row3 Row4 Row5 Line1 … … … … Line2 … … … … Line3 … … … … … Line 1838 … … … … I want to calculate several simple arithmetic means for Row5, th...
2011 Aug 23
1
subsetting a list of matrices
...<- c("V1", "V2", "V3") colnames(l$b) <- c("V1", "V2", "V3") colnames(l$c) <- c("V1", "V2", "V3") I want to extract values (row1, V1) for the three sublists a, b, c, but only for those cases in which row3 == "Message 1". Could someone suggest how to proceed? Many thanks in advance, Lara
2009 Dec 02
1
barchart() {Lattice} -- auto.key()
...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 -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 = 3:5), auto.key=list(space="right", rectangles=TRUE, poi...
2012 Feb 14
4
Color cells of a matrix as in Excel
...re preferred and colored green. I also want to print in each cell the numeric value, and I need to show row names. A crude example without the color: RowNames Col1 Col2 ---------------------------------------------- Row1 1 1 Row2 5 50 Row3 7.5 80 Row4 10 99 ...... Is there any R package that can do something similar? Can I create a plot that is a matrix of rectangles and get color and text that way? Any help is greatly appreciated. Thanks, John [[alternative HTML version deleted]]
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 = 3:5), auto.key=list(space="right"), border=NA ) I nee...
2011 Nov 07
2
adjusting levelplot color scale to data
...ooks something like this A B C D E row1 -0.5046406 -0.021579587 -0.4419101 -0.2999195330 -0.4845047 row2 -0.3070091 -0.059065936 0.3329806 -0.0519335420 -0.5766368 row3 -0.7271707 0.073282855 -0.3181990 -0.2485017700 -0.5732781 row4 0.3329806 -0.017762750 -0.1513197 -0.1016354970 0.2528442 levelplot(y) yields a color scale from red (-0.8 to 0.2) to blue (0.2 to 0.4) I'd want the color scale to be from red (-0.8 to 0) to...
2011 Jan 14
4
test
...9.56 89.87 30.39 2 0 80.54 93.32 21.76 2 0 82.11 92.58 22.17 2 14 84.48 91.23 20.44 2 14 85.22 93.08 22.54 2 14 83.89 92.74 25.11 etc etc etc etc etc I need to subtract from every number the other numbers of the same thesis and same day. Example: A(row1) - A (row2) (same for B and C) A(row1) - A (row3) etc until the last Thesis 1 and Day 0 A(row2) - A (row3) etc etc until the last Thesis 1 and Day 0 Same for the others theses and days. How can i do that? Sorry for my english. -- View this message in context: http://r.789695.n4.nabble.com/test-tp3217329p3217329.html Sent from the R help maili...
2013 Oct 25
0
[LLVMdev] Is there pass to break down <4 x float> to scalars
...ution except > decompose-vectors? Ah, no, the TBAA thing is separate really. llvmpipe generally operates on 4 rows at a time, so some functions end up with patterns like: load <16 x i8> row0 ... load <16 x i8> row1 ... load <16 x i8> row2 ... load <16 x i8> row3 ... ... do stuff ... store <16 x i8> row0 ... store <16 x i8> row1 ... store <16 x i8> row2 ... store <16 x i8> row3 ... Since the row stride is variable, llvm doesn't have enough information to tell that these rows don't alias. So it has to keep the...
2013 Oct 25
3
[LLVMdev] Is there pass to break down <4 x float> to scalars
Hi, Richard, I think we are solving a same problem. I am working on shader language too. I am not satisfied with current binaries because vector operations are kept in llvm opt. glsl shader language has an operation called "swizzle". It can select sub-components of a vector. If a shader only takes components "xy" for a vec4. it's certainly wasteful to generate 4
2018 Mar 15
3
stats 'dist' euclidean distance calculation
Hello, I am working with a matrix of multilocus genotypes for ~180 individual snail samples, with substantial missing data. I am trying to calculate the pairwise genetic distance between individuals using the stats package 'dist' function, using euclidean distance. I took a subset of this dataset (3 samples x 3 loci) to test how euclidean distance is calculated: 3x3 subset used
2008 Feb 07
1
How do you refer to the row above in a data frame ?
You have a two-dimensional data frame. Columns is easy, say col4 <- col3 - col2 How do you do row3 <- row2 +1 for example. -- View this message in context: http://www.nabble.com/How-do-you-refer-to-the-row-above-in-a-data-frame---tp15336933p15336933.html Sent from the R help mailing list archive at Nabble.com.