similar to: NA when indexing vectors

Displaying 20 results from an estimated 30000 matches similar to: "NA when indexing vectors"

2018 Nov 08
4
Visualizar grandes volumenes de datos
Buenas, He probado a intentar graficar mas de 700.000 puntos y es una locura. No doy con una libreria que consiga graficar grandes volumenes de datos. ?Existe alguna en R? Gracias Jes?s [[alternative HTML version deleted]]
2009 Dec 15
2
Random numbers for a group
Dear R helpers I have following table Name                 no_of_instances                    AAA                             12                                AA                               17                                A                                  0                                    BBB                             11                                 BB                        
2010 May 08
5
contar casos en un vector
Buenas noches, tengo dos vectores con nombres. El primero es largo, nombreL, y el segundo corto, nombreC. Quiero contar cuantas veces aparece alguno de los nombres del vector corto en el largo. Lo que estoy haciendo es lo siguiente: cuenta <- 0 topL <- length(nombreL) topC <- length(nombreC) for (i in 1:topL) { for (j in 1:topC) {
2013 Jun 18
2
find closest value in a vector based on another vector values
Dear All, would you please provide your thoughts on the following: let us say I have: a <-c(1,5,8,15,32,69) b <-c(8.5,33) and I would like to extract from "a" the two values that are closest to the values in "b", where the length of this vectors may change but b will allways be shorter than "a". So at the end based on this example I should have the result
2003 Jul 11
3
Indexing with NA as FALSE??
Hi Folks, Example: t<-c(1,2,3,4,5,6,7,8,9) u<-c(1,NA,3,NA,5,NA,7,NA,9) t[u==5] --> NA NA 5 NA NA Now, if I could somehow set things so that "NA" was FALSE for indexing, then t[u==5] --> 5 I know I can do it with t[(u==5)&(!is.na(u))] but in the situation I am dealing with this leads to massively cumbersome, typo-prone and hard-to-read code. Also, as an extra, it would
2014 Dec 09
3
Optimizar paste0()?
Gracias, Javier. Los datos "d" corresponden un archivo de texto de ~1.92GB. Voy a explorar la posibilidad con sqldf, aunque confieso que mi conocimiento de SQL es bastante limitado. Saludos cordiales, Jorge.- 2014-12-09 23:50 GMT+11:00 "Marcuzzi, Javier Rubén" < javier.ruben.marcuzzi en gmail.com>: > Estimado Jorge Velez > > ¿Que pasa si usa sqldf que
2015 May 27
2
libsmbclient question
Dear Gents, We are using libsmbclient smbc_getFunctionRead to read from a Microsoft DFS share. Before each 64k read there are a QUERY_PATH_INFO and a GET_DFS_REFERRAL which slow down the transmission. Is there a way to query these only once at the beginning of the transmission and cache it? system: 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24) x86_64 GNU/Linux lib:
2008 Oct 11
5
Extracting subset of a vector
I have 2 vecros : x<-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) x1 = sample(x, 5, replace=FALSE) Now i want to get remaining values of vector "x" those are not member of vector "x1". Can anyone please tell me how to do that?
2008 Jul 07
5
question on lm or glm matrix of coeficients X test data terms
Hi, is there an easy way to get the calculated weights in a regression equation? for e.g. if my model has 2 variables 1 and 2 with coefficient .05 and .6 how can I get the computed values for a test dataset for each coefficient? data var1,var2 10,100 so I want to get .5, 60 back in a vector. This is a one row example but I would want to get a matrix of multiplied out coefficients
2014 Dec 09
2
Optimizar paste0()?
Hola a todos, Me gustaria construir un vector a partir de otros dos. Ejemplo: x <- 1:3 y <- 4:6 d <- data.frame(x, y) d$z <- with(d, paste0(x, ":", y, "-ABC")) d El problema es "d" tiene ~70 millones de filas y toma mucho tiempo construir el vector "z". Alguna sugerencia? Muchas gracias, Jorge Velez [[alternative HTML version deleted]]
2012 Oct 18
3
how to concatenate factor vectors?
How do I concatenate two vectors of factors? --8<---------------cut here---------------start------------->8--- > a <- factor(5:1,levels=1:9) > b <- factor(9:1,levels=1:9) > str(c(a,b)) int [1:14] 5 4 3 2 1 9 8 7 6 5 ... > str(unlist(list(a,b),use.names=FALSE)) Factor w/ 9 levels "1","2","3","4",..: 5 4 3 2 1 9 8 7 6 5 ...
2009 Aug 08
1
interesting statistics article in NYT
[This email is either empty or too large to be displayed at this time]
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
2014 Dec 09
3
Optimizar paste0()?
Hola, Otra forma, quizás algo más rápida, especialmente para unos conjuntos tan grandes, que la de sqldf es "data.table": library(data.table) x <- 1:3 y <- 4:6 d <- data.table(x, y) d[,z := paste(x,"-",y,sep="")] > d x y z 1: 1 4 1-4 2: 2 5 2-5 3: 3 6 3-6 Y bueno, "dplyr" también es otra opción muy rápida... También, y recuerdo que hace
2013 Aug 25
3
Rodondeo de una matriz
Gracias, Jorge. Y cual fue la solucion a la que llegaron? --JIV Sent from my phone. Please excuse my brevity and misspelling. On Aug 25, 2013, at 8:36 AM, Jorge Ayuso Rejas <jayusor@gmail.com> wrote: Esto lo hice yo en una práctica en la universidad, Definíamos un problema de optimización entera minimizando el error de redondeo y restringiendo a la suma de filas y columnas. El 23 de
2015 Jul 04
2
Problema con loop
Muchas gracias Jorge! Si la opción del loop con for ya la tenía implementada y me demora bastante por eso quería probar con apply o en este caso sapply, muchas gracias! Saludos!! F Macedo El 03/07/15 a las 23:09, Jorge I Velez escribió: > Hola Fernando, > > Podrias considerar las siguientes opciones: > > R2 <- vector("list", x) > for(i in 1:x){ > modelo
2009 May 16
6
Modificando heatmaps
Hola a todos, Estoy trabajando con la función heatmap.2() de la libreria ggplots. A continuación encontrarán un ejemplo de la estructura de mis datos y el código para generar el gráfico que me gustaría modificar: # Datos set.seed(123) x <- matrix(rnorm(8*30), ncol = 8) rownames(x) <- paste(''GM10A'',1:30,sep="") colnames(x) <-
2015 Jul 05
2
Problema con loop
Hola Jorge. Usando sapply mejoró un poco pero no demasiado en realidad. Una vez lo estuve relojeando a mclapply (y otras funciones de ese paquete), pero no probé mas allá de algunos ejemplos. Voy a terminar este trabajo y lo pruebo, ya te contaré cuanto mejoró. Un abrazo y gracias nuevamente! El 5 de julio de 2015, 11:27, Jorge I Velez <jorgeivanvelez en gmail.com> escribió: > De
2008 Apr 28
5
Combine Values into a Vector or List
Hi all, I have the following x1<-paste("A", 1:6, sep = "") x2<- round(rgamma(6,2,1)) x3<-paste("B", 1:6, sep = "") x4<- round(rgamma(6,2,1)) data1 <- data.frame(x1,x2,x3,x4) I would like to get data2 <- c(A1=4, A2=1, A3=0,...) Is there any standard for such a case? Thank you very much in advance, Diego
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)