similar to: matrix filtering and reordering

Displaying 20 results from an estimated 10000 matches similar to: "matrix filtering and reordering"

2008 Jan 17
1
Res: vector generation
hi Juan, It is not so elegant, but work fine. I know that our colleagues can do it on a simple line. z<-c(526,723,110,1110,34,778,614,249,14) v1<-NULL v2<-NULL for (i in 1:(length(z)-1)) { for (j in i:length(z)) { v1<-rbind(v1,z[i]) v2<-rbind(v2,z[j]) } } df<-data.frame(cbind(v1=v1,v2=v2)) names(df)<-c("v1","v2") df$ratio<-df$v1/df$v2 Kind regards,
2009 Feb 22
2
filtering a simple matrix
Hi all, I have the next matrix: a b c 1 2 23 2 3 42 3 0 54 4 5 23 5 0 22 6 7 21 7 1 20 8 9 19 I want to filter the rows with the values of b higher than 1 in a way that leaves me the next matrix: a b c 1 2 23 2 3 42 4
2009 Apr 14
2
matrix merge problem
Dear r-help contributors, I have two questions: first: I have a matrix A and a vector B. I want to make a new matrix C, which is made of the rows of A having a value included in B. Second: I have two matrixes A and B, of different dimensions. B has unique values in column 2 and A has not unique values on column 2. I want to merge this two matrixes by the values in the columns 2 of B and 2 of
2007 Nov 22
4
more outrageous plotting
Dear Contributors: I have the next matrix: "X" "Y" "Z" 1 2 526 2 5 723 3 10 110 4 7 1110 5 9 34 6 8 778 7 1 614 8 4 876 9 6 249 10 3 14 I want to order the matrix from bigest Z (1110) to lower Z (14). Then I want to asign a color scale vector from blue ( bigest Z) to orange
2007 Jul 05
3
help with vector construction
Hi all, I want to make a vector with the third column of a matrix, but only for the 2+3n rows of the matrix, with n being an entire number from 0 to a million. How can I do that in an easy way? Thanks in advance, Juan Pablo [[alternative HTML version deleted]]
2007 Feb 27
4
ordered matrix question
Hi all, Is there an easy way to generate an object wich will be the same matrix, but ordered by de cfp value? The data frame consists of numeric columns: "Block" "X" "Y" "cfp" "yfp" "ID" 0 524 244 213.41795 7.18482109 1 0 556 270 65.383904 9.568372661 2 0 528 316 40.789474
2008 Jan 24
4
two histograms in the same graph
Dear Contributors: I have two vectors x and z, and I want to display the histograms of both vectors in the same graph, x in red bars, z in blue bars. If you have any clue on how to do that, I will be very glad to hear it!!!!!! Thanks in advance again, Juan Pablo Fededa [[alternative HTML version deleted]]
2008 Jan 17
3
vector generation
Dear Contributors: I have the next vector: "Z" 526 723 110 1110 34 778 614 249 14 I want to generate a vector containing the ratios of all the values versus all the values of the z vector. I mean a vector containing the values of 526/723, 526/110, and so on, 723/723, 723/110, and so on, and so on. Is this doable in a simple way?? Thanks in advance again, Juan Pablo Fededa
2008 May 15
1
value transformations in a vector
Dear contributors: I have vector A composed of numbers wich have values equal to 1 and different to 1. I want to transform de components with a value=1 to a component of value=0, and those with a value different to1, to a value=1. Then I want to take out the components=0. Thanks in advance, Juan Pablo [[alternative HTML version deleted]]
2010 Oct 11
2
compare histograms
Hello How to compare  two statistical histograms? How i can know if these histograms are equivalent or not??   Regards [[alternative HTML version deleted]]
2007 Nov 22
1
axis invertion
Hi all, I want to invert the y axis of a plot, how can I do that in an easy way? Thanks in advance, Juan Pablo
2013 Dec 03
2
cambiar visión de un "plot"
Hola. Estoy trabajando con "plot" en R y quiero dibujar un punto justo encima del eje x porque es el punto que andaba buscando. Es decir, he encontrado su coordenada "x" y la "y" vale cero. ¿Cómo puedo dibujar un punto que corte los ejes? (porque normalmente se me queda dentro de la gráfica). Además, aunque le exija que empiece en el cero, el eje y no emepieza
2018 Jul 04
2
Operaciones con Arrays...creo.
Muchas gracias, Javier, por tu respuesta. Me sobrevalorás. Mi última clase de matemática como tal fue en 4º de secundaria, y era la matemática que nos daban a los de letras. Ni te cuento hace cuántos años. No puedo seguir la mayoría de lo que comentás sin hacer un trabajo forense. Así que agarré lo que entendí... y me parece que, o lo que yo quiero hacer son matrices de tres dimensiones (si es que
2013 Dec 04
3
agregar meses con compras 0 cuando no aparece mes por no. de cliente
Estimados usuarios de R: Tengo que pedirles ayuda. Tengo un dataframe en el cual por número de vendedor tengo las ventas mes a mes que realizaron. No todos los vendedores tienen ventas todos los meses. A los vendedores que aparecen en la lista quiero agregarles ventas iguales cero en aquellos meses que no aparecen en el data.frame. Por ejemplo el data.frame se podría ser así: no_cliente
2015 Nov 08
2
desviacion estandard
Hola, ¿qué tal? Lo que te pasa no es tan raro: set.seed(1234) muestra <- abs(rnorm(100)) sd(muestra) #[1] 0.5811866 muestra.ceros <- c(muestra, rep(0, 100000)) sd(muestra.ceros) #[1] 0.03196273 En una muestra de números positivos, añadir un cero (sobre todo si está lejos de la media) sube la varianza. Si añado otro, posiblemente también. Pero cuando añado muchísimos ceros, la varianza
2014 Nov 06
2
diferentes escalas en el X de un grafico con varios paneles
Estimados, tengo el siguiente problema: Tengo que graficar la concentracion de un metabolito en algunas muestras contra la concentracion del solvente con que fue extraido. Las concentraciones varian desde cero (para un control) hasta varios miles de unidades de concentracion (miliMolar). Para que se puedan diferenciar los puntos en el eje X, se ha usado una escala logaritmica. Hasta ahi todo
2010 May 04
4
Contar rachas en una matriz
Buen día a todos el problema que tengo es el siguiente: tengo una matriz 0 0 0 1 5 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 6 0 0 0 0 0 0 0 0 0 1 4 0 1 0 7 2 9 0 1 necesito hacer el primer conteo de números hasta que encuentre el primer cero. para la fila 1: tiene 1 y 5 son dos elementos fila 2: solo tiene 1 elemento fila 3: tiene 1 fila 4: 1 y 6 dos elementos fila 5: no tiene elementos distintos de
2018 Jul 04
2
Operaciones con Arrays...creo.
Buenas, Sigo aprobechando par aaprender en las vacaciones de alumnos y nuevamente recurro a Uds. Sé que la perspectiva puede ser erronea, o sea que les pido que entiendan lo que quiero decir, más que lo que digo. Tengo una lista de matrices todas de idénticas dimensiones, y necesito hacer operaciones entre ellas. Ocurrencia: creí que podría hacer un array, de tal manera que , así como puedo
2015 Oct 29
2
Extraer elementos diagonales de submatrices
El código que me olvide pegar input m <- structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5), .Dim = c(10L, 5L)) m ## output output <- c(1:3, 1:5, 1:2) output nfilas <- nrow(m) while(nfilas > 0) { diagonal <- diag(m)
2015 Oct 28
3
Extraer elementos diagonales de submatrices
Estimado Javier, Gracias por tu mensaje. No, lo unico que requiero es la lista de números (i1, 2, 3, 1, 2, 3, 4, 5, 1, 2). Saludos cordiales, Jorge.- 2015-10-28 14:35 GMT-05:00 Javier Rubén Marcuzzi < javier.ruben.marcuzzi en gmail.com>: > Estimado Jorge I Velez > > > > No comprendo un punto, dices que deseas construir sub matrices y extraer > elementos de sub