search for: row4

Displaying 17 results from an estimated 17 matches for "row4".

Did you mean: row
2013 May 01
1
Combine multiple tables into one
...gt; ?>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 combined table should l...
2008 Sep 04
1
restricted bootstrap
...(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 version deleted]]
2009 Mar 05
3
Dropping rows conditionally
...ly 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 row6 16 17 18 ro...
2009 Aug 27
1
generating multiple sequences in subsets of data
...1 7 1 2 8 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&l...
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(dimnames(dta))[2...
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, that is fr...
2009 Dec 02
1
barchart() {Lattice} -- auto.key()
...d 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, points = FALSE),...
2012 Feb 14
4
Color cells of a matrix as in Excel
...lso 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 need help with: 1...
2011 Nov 07
2
adjusting levelplot color scale to data
...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 blue (0 to 0.4) ----- Lanna -- View this message in context: http://r.789695.n4.na...
2006 Mar 28
1
weights in glm (PR#8720)
...ly = quasipoisson, weights = w) ###end of the code#### When I have written summary(fit) I have got: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.64459 NA NA NA Row2 -0.05467 NA NA NA Row3 0.24541 NA NA NA Row4 0.42035 NA NA NA Row5 0.43961 NA NA NA Row6 0.04532 NA NA NA Row7 -0.04881 NA NA NA Row8 0.25370 NA NA NA Row9 -0.14976 NA NA NA Row10...
2009 Dec 02
1
Fw: Re: Help: barchart() {Lattice}
...s 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...
2005 Apr 25
4
panel ordering in nlme and augPred plots
...lot(augPred(fit.nlme6, level=0:1), ord.f) The only thing I found out is that if I order grouped.data object gr.dat<-gr.dat[ord.f,] and do nlme fit, then the ordering in augPred plot is OK. BTW is there a way how to specify in plot row1 -> 3 panels row2 -> 3 panels row3 -> 3 panels row4 -> 2 panels row5 -> 4 panels Thank you Best regards Petr Pikal petr.pikal at precheza.cz
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
2007 Dec 07
0
Bug#454678: r-base-core: Crash when calling edit.matrix with edit.row.names = TRUE when there are no rownames (PR#10500)
...racter"), modes) } This results in: > mat <- matrix(rnorm(30), nrow = 10, ncol = 3); edit(mat, edit.row.names = TRUE) col1 col2 col3 row1 0.6185206 0.32911907 -0.12263839 row2 0.4553981 -1.77532265 2.06745757 row3 0.4676557 0.58817426 -0.30507048 row4 1.1898153 -1.24888167 1.02240513 row5 -1.4809138 0.05212133 0.25272844 row6 1.5709981 -1.87496256 -0.05699266 row7 0.3770318 -0.43538598 -1.28299648 row8 1.3900096 0.15139637 -1.01168270 row9 -0.3973376 0.05933193 0.34420058 row10 -1.4248380 0.86637712 -1.25193470 > q() when th...
2007 Dec 07
0
(PR#10500) Bug#454678: r-base-core: Crash when calling
...t; This results in: >> mat <- matrix(rnorm(30), nrow = 10, ncol = 3); edit(mat, edit.row.names = TRUE) > col1 col2 col3 > row1 0.6185206 0.32911907 -0.12263839 > row2 0.4553981 -1.77532265 2.06745757 > row3 0.4676557 0.58817426 -0.30507048 > row4 1.1898153 -1.24888167 1.02240513 > row5 -1.4809138 0.05212133 0.25272844 > row6 1.5709981 -1.87496256 -0.05699266 > row7 0.3770318 -0.43538598 -1.28299648 > row8 1.3900096 0.15139637 -1.01168270 > row9 -0.3973376 0.05933193 0.34420058 > row10 -1.4248380 0.86637712...
2007 Jan 05
4
Fast Removing Duplicates from Every Column
Hi, I'm looking for some lines of code that does the following: I have a dataframe with 160 Columns and a number of rows (max 30): Col1 Col2 Col3 ... Col 159 Col 160 Row 1 0 0 LD ... 0 VD Row 2 HD 0 0 0 MD Row 3 0 HD HD 0 LD Row 4 LD HD HD 0 LD ... ... LastRow HD HD LD 0 MD Now I want a dataframe that looks like this. As you see