Re: [R] svymean using the survey package - strata containing no subpopulation members

2016-06-22 Thread Anthony Damico
hi pradip, with meps you should be able to match precisely between r+survey and those other languages[1] if i had to guess, i would say that your sas and stata code is actually doing the equivalent of this, which is not correct. check the journal article table #1 for syntax comparisons

[R] svymean using the survey package - strata containing no subpopulation members

2016-06-22 Thread Muhuri, Pradip (AHRQ/CFACT)
Hi, Below is a reproducible example that produces the estimate of "totexp13" (total health care expenditure 2013) for the subpopulation that includes "Asians with diabetes diagnosed" in MEPS. The R script below downloads file from the web for processing. Issue/Question: The R/survey package

Re: [R-es] Ayuda sencilla (SQL)

2016-06-22 Thread Carlos Ortega
Hola, Hay una forma más sencilla utilizando "table()"... > datIn <- read.table("Datos.csv", sep = ";", header = TRUE) > datIn <- na.omit(datIn) > Cont_df <- as.data.frame(table(datIn$Laboratorio, datIn$Camara)) > Cont_end <- Cont_df[ Cont_df$Freq > 0, ] > Cont_end <- Cont_end[

Re: [R-es] Ayuda sencilla (SQL)

2016-06-22 Thread Mauricio Monsalvo
Claro, porque es "sqldf" y no "sqldb" :) Gracias de nuevo. Prometo volver a mirar el código antes de molestar en el grupo la próxima vez. El 22 de junio de 2016, 20:27, Carlos Ortega escribió: > Estoy en 3.3.0 y "sqldf" lo instala sin problemas... > > El 23 de junio

Re: [R-es] Ayuda sencilla (SQL)

2016-06-22 Thread Mauricio Monsalvo
Malas nuevas para mi: package ‘sqldb’ is not available (for R version 3.3.0) ¿Puedo hacer algo más que esperar? No me voy a "bajar" de versión de R. El 22 de junio de 2016, 20:02, Mauricio Monsalvo escribió: > Muchas gracias, Carlos. > Sobre todo por el sqldf, que seguro

Re: [R-es] Ayuda sencilla (SQL)

2016-06-22 Thread Carlos Ortega
Hola, Estas pueden ser posibles soluciones: http://stackoverflow.com/questions/5459454/counting-unique-items-in-data-frame http://stackoverflow.com/questions/10112177/how-to-count-distinct-entries-within-a-column-of-a-data-frame Y si envías un mínimo conjunto de datos para terminar de entender

[R-es] Ayuda sencilla (SQL)

2016-06-22 Thread Mauricio Monsalvo
Hola Necesito algo simple pero no logro resolverlo en R: contar elementos distintos (unique) pero agrupados. En SQL sería: SELECT Camara, count(DISTINCT(Laboratorio)) as Lab FROM [datos] GROUP BY Camara. Puedo hacerlo para toda la matriz de datos con length(unique(datos$Laboratorio)) pero no logro

Re: [R] issues with R raster temporary files

2016-06-22 Thread William Dunlap via R-help
I think there is a bug in raster::removeTmpFiles(). Near the end it has f <- f[dif > h] if (length(f) > 1) { unlink(f, recursive = TRUE) } so it only tries to remove the files listed in 'f' if there is more than one of them. Perhaps the author meant to use '>='

Re: [R] Y in Kohonen xyf function

2016-06-22 Thread K. Elo
Hi! 22.06.2016, 22:00, chalabi.el...@yahoo.de wrote: Dear Kimmo, I already used df$speed[training] in df.xyf but I get this error: Error in xyf(Xtraining,factor(df$speed[training]),grid=somgrid(5, : NA/NaN/Inf in foreign function call (arg 1) Please check for zeros (0) and NAs in

[R] issues with R raster temporary files

2016-06-22 Thread Alex Thorn
Hello. I am running into difficulties running some older scripts I produced in 2014 to handle raster data using the R package "raster". I have the feeling that some behavior has changed with an upgrade but don't remember what version I was using when I wrote the scripts. Can somebody help me

Re: [R] Y in Kohonen xyf function

2016-06-22 Thread ch.elahe via R-help
Dear Kimmo, I already used df$speed[training] in df.xyf but I get this error: Error in xyf(Xtraining,factor(df$speed[training]),grid=somgrid(5, : NA/NaN/Inf in foreign function call (arg 1) On Wednesday, June 22, 2016 3:48 AM, K. Elo wrote: Hi again! 21.06.2016,

[R] Problem with rJava

2016-06-22 Thread Ruediger Port
Hit the same error message when trying install.packages('rJava') in R 3.2.2 under SuSE Linux, version Leap 42.1 : Begin of error message configure: error: One or more Java configuration variables are not set. Make sure R is configured with

Re: [R] biplot

2016-06-22 Thread David L Carlson
I should have mentioned that the points are invisible without the labels and there is no way to use plot symbols. Something like this is probably what you wanted. > biplot(prcomp(x), xlabs=rep("*", 50), ylabs=rep("", 10)) Gives you the arrows and asterisks for the points. But labeling them is

Re: [R] biplot

2016-06-22 Thread David L Carlson
The xlabs= (rows) and ylabs= (columns) arguments handle the labels, but they do not recycle so you need to specify values for each row and each column: > set.seed(42) > x <- matrix(rnorm(500), 50, 10) > biplot(prcomp(x), xlabs=rep("", 50), ylabs=rep("", 10))

Re: [R] [FORGED] Ask function missing in package car

2016-06-22 Thread Ashim Kapoor
wow. Cool. Many thanks, Ashim On Wed, Jun 22, 2016 at 9:08 PM, David L Carlson wrote: > Since R is open source, the source code for packages is stored on CRAN > mirrors. A little navigation gets us to > > https://cloud.r-project.org/src/contrib/Archive/car/ > > Loading

Re: [R] [FORGED] Ask function missing in package car

2016-06-22 Thread David L Carlson
Since R is open source, the source code for packages is stored on CRAN mirrors. A little navigation gets us to https://cloud.r-project.org/src/contrib/Archive/car/ Loading car_1.2-16.tar.gz, the last version before car_2.0 gives the code for Ask(): # change an argument to a function

Re: [R] gbresolve function from the geiger package

2016-06-22 Thread Nomi Hadar
o.k I found that I have to update my local copy of ncbi, but when I do: *ncbit(update=TRUE)* I get: *"NCBI GenBank taxonomy assembled 2013-03-29"* Why it was not updated? Thanks Nomi 2016-06-20 14:11 GMT+03:00 Nomi Hadar : > Hello, > > I have troubles with the

[R] biplot

2016-06-22 Thread Shane Carey
Hey, Does anyone know how to remove labels from a biplot? I want to input them manually as they are currently overlapping. Thanks -- Le gach dea ghui, Shane [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To

[R-es] Shiny

2016-06-22 Thread Eduardo Bieñkowski
Estoy trabajando generando mapas a partir de un conjunto de datos. No puedo encontrar la forma de manipular el tamaño de los mapas. He buscado en páginas de Shiny y no pude encontrar una solución ¿Alguien me puede orientar? No he puesto una imagen para no recargar el servidor de correo. Saludos y

Re: [R] Y in Kohonen xyf function

2016-06-22 Thread K. Elo
Hi again! 21.06.2016, 21:33, chalabi.el...@yahoo.de wrote: Hi Kimmo, Thanks for your reply. I think now my problem is that I don't understand what does factor(df.classes[training]) do? Sorry, my mistake, should habe been 'df$speed'. Please try the following: --- snip --- set.seed(7)

Re: [R] [FORGED] Re: Generate list if sequence form two vector element

2016-06-22 Thread Mohammad Tanvir Ahamed via R-help
Thanks everyone for the solutions !! Tanvir Ahamed Göteborg, Sweden | mashra...@yahoo.com - Original Message - From: Keith Jewell To: r-h...@stat.math.ethz.ch Sent: Wednesday, 22 June 2016, 11:54 Subject: Re: [R] [FORGED] Re: Generate list if sequence

Re: [R] [FORGED] Re: Generate list if sequence form two vector element

2016-06-22 Thread Keith Jewell
or as a one-liner mapply(pmin(a, b), pmax(a,b), FUN=seq, SIMPLIFY=FALSE) On 22/06/2016 10:23, peter dalgaard wrote: There's also mapply(a, b, FUN=seq, SIMPLIFY=FALSE) (turn off simplication so that you don't unexpectedly get a matrix whenever all elements of results have same length. This

Re: [R] [FORGED] Re: Generate list if sequence form two vector element

2016-06-22 Thread peter dalgaard
There's also mapply(a, b, FUN=seq, SIMPLIFY=FALSE) (turn off simplication so that you don't unexpectedly get a matrix whenever all elements of results have same length. This also affects apply()-based solutions.) ...except that according to original spec, one should ensure a < b. So myseq <-

Re: [R-es] Pregunta sobre shinyTable

2016-06-22 Thread Víctor Granda García
Yo siempre que he querido hacer cosas así he usado el paquete DT (htmlwidget para data tables) y te permite añadir scrolls y paginación de la tabla, además de formato condicional... vamos, que es muy completo. Un saludo. El mié., 22 jun. 2016 10:11, Francisco Rodríguez

Re: [R] [FORGED] Re: Generate list if sequence form two vector element

2016-06-22 Thread Jim Lemon
Now why didn't I think of that? apply(matrix(c(a,b),ncol=2),1,function(x)x[1]:x[2]) Jim On Wed, Jun 22, 2016 at 6:14 PM, Rolf Turner wrote: > On 22/06/16 20:00, Jim Lemon wrote: >> >> Hi Tanvir, >> Not at all elegant, but: >> >> make.seq<-function(x)

Re: [R] [FORGED] Re: Generate list if sequence form two vector element

2016-06-22 Thread Rolf Turner
On 22/06/16 20:00, Jim Lemon wrote: Hi Tanvir, Not at all elegant, but: make.seq<-function(x) return(seq(x[1],x[2])) apply(matrix(c(a,b),ncol=2),1,make.seq) Not sure that this is more "elegant" but it's a one-liner: lapply(1:length(a),function(i,a,b){a[i]:b[i]},a=a,b=b) cheers, Rolf On

Re: [R] Generate list if sequence form two vector element

2016-06-22 Thread Jim Lemon
Hi Tanvir, Not at all elegant, but: make.seq<-function(x) return(seq(x[1],x[2])) apply(matrix(c(a,b),ncol=2),1,make.seq) Jim On Wed, Jun 22, 2016 at 5:32 PM, Mohammad Tanvir Ahamed via R-help wrote: > Hi, > I want to do the follow thing > > Input : > a <- c(1,3,6,9) > >

[R] Generate list if sequence form two vector element

2016-06-22 Thread Mohammad Tanvir Ahamed via R-help
Hi, I want to do the follow thing Input : a <- c(1,3,6,9) b<-c(10,7,20,2) Expected outcome : d<-list(1:10,3:7,6:20,2:9) Thanks !! Tanvir Ahamed Göteborg, Sweden | mashra...@yahoo.com __ R-help@r-project.org mailing list -- To

Re: [R-es] ftable exportar

2016-06-22 Thread miguel.angel.rodriguez.muinos
Hola Javier. Una opción es escribir el fichero directamente en Excel (por ejemplo con XLConnect) > require(XLConnect) # cargar el fichero > fichero=loadWorkbook(nombre_del_fichero, create=FALSE) > datos=readWorksheet(fichero, sheet=1) # Grabar los datos >