Re: [R] error using by(goop[, c("a", "b", "c")], goop[, "Arm"], mySD) was Re: by gives no results, gives warning that data are non-numeric, but the data appears to be numeric.

2015-12-28 Thread ruipbarradas
Hello, Try the following. mySD <- function(x) {sapply(x, function(y) sqrt(var(y)))} Hope this helps, Rui Barradas   Citando John Sorkin : > I am  trying to use the by function to get the SD of each column of > a data frame, stratified by ARM. Using a suggestion

[R] Format a dataset for use with R with chunking

2015-12-28 Thread Mark Finkelstein
The problem is common, I have 100GB of data, but only 8GB of RAM. I was thinking of transforming the 100GB of data, which right now is in a nonCSV, fixed row format, to something that R could load quickly and easily in chunks - sort of like pages perhaps. I might be able to do this with some SQL

Re: [R] Multidimensional array

2015-12-28 Thread veni arakelian via R-help
Dear David The first three arrays are of the formval(:,:,1) =      1     1     1     1     1     1     1     1     1 val(:,:,2) =      1     0     0     0     1     1     0     1     1 val(:,:,3) =      1     0     0     0     1     1     0     1     1 So I plan to import them in R as a single

[R] error using by(goop[, c("a", "b", "c")], goop[, "Arm"], mySD) was Re: by gives no results, gives warning that data are non-numeric, but the data appears to be numeric.

2015-12-28 Thread John Sorkin
I am trying to use the by function to get the SD of each column of a data frame, stratified by ARM. Using a suggestion provided by both William Dunlap and Rolf Turner, I have written the code below which fails with the error: Error in match.fun(FUN) : 'sqrt(var(x))' is not a function,

Re: [R] [FORGED] Mixed Beta Disrubutions

2015-12-28 Thread David Winsemius
> On Dec 28, 2015, at 4:35 PM, mesude bayrakci wrote: > > Hello, > > "Treat everyone with politeness, even those who are rude to you - not > because they are nice, but because you are" It's generally considered rude to accuse someone of rudeness. However customs in

Re: [R] ?currency challenge ?knapsack challenge ?probabilities

2015-12-28 Thread Polwart Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST)
Hi Jim Working on basis of exact match. but the 25% inncrements are rounded to imtegers, so like buying from a shop priced in whole numbers but changeis what you expect not 'roughly right' Thanks Calum On 27 Dec 2015, at 22:04, Jim Lemon >

Re: [R] rugarch package: VaR exceedances plot

2015-12-28 Thread Giorgio Garziano
My suggestion is to inspect the VaRplot source code and, also with the help of debug() if necessary, you may verify how ylim results with your data. > VaRplot function (alpha, actual, VaR, title = paste("Daily Returns and Value-at-Risk \nExceedances\n", "(alpha=", alpha, ")", sep = ""),

Re: [R] need for help for solving operations in a vector

2015-12-28 Thread PIKAL Petr
Hi On top of answers you have got here is some plotting you need to answer yourself plot(qWC1, col=(c(0, diff(qWC1))>=0 )+1) Which from those red points you want to be included in irrigation period? All of them? Only part? Which part? Based on your figures you probably will not get 100%

Re: [R] by gives no results, gives warning that data are non-numeric, but the data appears to be numeric.

2015-12-28 Thread John Sorkin
Thank you, John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone)

Re: [R] matrix which results singular but at the same time positive definite

2015-12-28 Thread Stefano Sofia
Dear Dr.Gilbert, it took me a bit of time to understand your thoughtful comment. You are right on everything. I was not able to see it, and likely I still have something to understand better some consequences on what I am trying to do. Thank you Stefano

Re: [R] Right censored data, abundant in zeros for regression analysis.

2015-12-28 Thread Cade, Brian
Tom: One possibility might be to use the censored quantile regression implementation (crq) in the quantreg package (accommodates left or right censoring) across a range of quantiles (e.g., 0.05 to 0.95) but where interest is likely to be focused on estimates for quantiles greater than the

[R] Multidimensional array

2015-12-28 Thread veni arakelian via R-help
Hi All. I'm very new in R. I'd like to import data of the form MxMxT, i.e., MxM array in T distinct points. Any ideas how to do that? Regards, Veni  [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To

[R] Incorrect Summarization after As.numeric

2015-12-28 Thread SHIVI BHATIA
Dear Team, I am working on aggregate function in R & have used the below code: aggregate(a1$Final,list(Year=a1$Year),sum) initially a1$Final was factor hence I used a1$Final= as.numeric(a1$Final) to convert this into numeric. After conversion it shows the output but the summarization

Re: [R] Incorrect Summarization after As.numeric

2015-12-28 Thread Ista Zahn
FAQ 7.10 perhaps. On Dec 28, 2015 10:51 AM, "SHIVI BHATIA" wrote: > Dear Team, > > > > I am working on aggregate function in R & have used the below code: > > > > aggregate(a1$Final,list(Year=a1$Year),sum) > > > > initially a1$Final was factor hence I used a1$Final=

Re: [R] Format a dataset for use with R with chunking

2015-12-28 Thread William Dunlap via R-help
What do you hope to do with this data while it is in R? E.g., do you want to plot it, fit a model to it, to select a few rows or columns from it, sort it, summarize lots of small subsets of it, or something else? Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Dec 28, 2015 at 1:39 PM, Mark

Re: [R] interpolation using R for PCR quantification

2015-12-28 Thread Jeff Newmiller
There is some terminology confusion here... interpolation as implemented by approx or spline usually means estimating values between known points. You seem to have approximate (not known) points, and are looking to apply a linear regression model to estimate missing data. Beware that mixing

Re: [R] [FORGED] Mixed Beta Disrubutions

2015-12-28 Thread Rolf Turner
On 29/12/15 08:40, mesude bayrakci wrote: Hello, I have data; one column and 310 rows. When I plot the histogram, it has two peaks; please see the attachment. I would like to find appropriate distribution that fits the data. I tried to mixtools in R, but it did not fit well. I want to mix two

Re: [R] Incorrect Summarization after As.numeric

2015-12-28 Thread Sarah Goslee
You probably want as.numeric(as.character(myfactor)) since the underlying numeric representation of a factor that's obtained with as.numeric() does not match what you see if your factor "appears" numeric. > myfactor <- as.factor(c("5", "6", "43", "22", "5", "22", "22")) > myfactor [1] 5 6 43

[R] Mixed Beta Disrubutions

2015-12-28 Thread mesude bayrakci
Hello, I have data; one column and 310 rows. When I plot the histogram, it has two peaks; please see the attachment. I would like to find appropriate distribution that fits the data. I tried to mixtools in R, but it did not fit well. I want to mix two beta distribution. I found that there is

Re: [R] Multidimensional array

2015-12-28 Thread David Winsemius
> On Dec 27, 2015, at 11:49 PM, veni arakelian via R-help > wrote: > > > > Hi All. > > I'm very new in R. I'd like to import data of the form MxMxT, i.e., MxM array > in T distinct points. > Any ideas how to do that? It will depend on the form in which this data is

Re: [R] Incorrect Summarization after As.numeric

2015-12-28 Thread John Kane
It would likely help to have some sample data. Please have a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz/Reproducibility.html John Kane Kingston ON Canada > -Original Message- > From:

[R] randomForestSRC VIMP interpretation

2015-12-28 Thread Claire's Daddy
Hi, For a binary classification model, why variable importance produces separate importance for each outcome? What does column N and R stand for? I thought only the first column 'all' is needed. (i.e. randomly permute variable x, calculated change in out-of-bag prediction error. Code *model <-

Re: [R] Multidimensional array

2015-12-28 Thread Jeff Newmiller
Welcome to r-help. There are multiple ways to import various kinds of data, but they tend to be organized around how the data are represented in disk files, but you have given no hints about what you have on disk to work with. Also, such data are sometimes represented in memory in so-called

Re: [R] Mixed Beta Disrubutions

2015-12-28 Thread Ryan Derickson
Smug, self-satisfied responses are becoming more common as exemplified here. These contribute to nothing except the author's ego and distract from the generous and patient help others provide. Regardless of how naive the questioner or how well-credentialed the respondent, the community would

Re: [R] [FORGED] Mixed Beta Disrubutions

2015-12-28 Thread Oliver Keyes
I'm sorry, but there's no universe in which replying to a good faith question with "Given your level of obtuseness I think that the advancement of science would be best served if you were not encouraged to pursue this line of endeavour any further." is polite. That's rude. It would be totally

Re: [R] Mixed Beta Disrubutions

2015-12-28 Thread Jim Lemon
Hi mesude, Achim's example seems particularly clear. Install the "betareg" and "flexmix" packages. I obtain a reasonable looking result for alpha and beta for a simulated dataset very similar to yours. > a Comp.1 Comp.2 10.0674445 0.6452801 > b Comp.1 Comp.2 2.830934 0.769768 Jim

Re: [R] Mixed Beta Disrubutions

2015-12-28 Thread mesude bayrakci
Hello all, This would be my last comments on "politeness" discussion started after my email, and do not want to keep the forum busy with this. Please do not continue writing on this matter to the forum. First of all, I just started using R for a short period of time, and using it for a small

Re: [R] Multidimensional array

2015-12-28 Thread David Winsemius
> On Dec 28, 2015, at 1:10 PM, veni arakelian wrote: > > Dear David > > The first three arrays are of the form > val(:,:,1) = > > 1 1 1 > 1 1 1 > 1 1 1 > > > val(:,:,2) = > > 1 0 0 > 0 1 1 > 0

Re: [R] error using by(goop[, c("a", "b", "c")], goop[, "Arm"], mySD) was Re: by gives no results, gives warning that data are non-numeric, but the data appears to be numeric.

2015-12-28 Thread William Dunlap via R-help
sapply's FUN argument must be a function (or a character string naming a function) and sqrt(var(x)) evaluates to a number, not a function. mySD <- function(x) {sapply(x,function(x)sqrt(var(x)))} would work, but I like to make it mySD <- function(x) {sapply(x,function(xi)sqrt(var(xi)))} to make

Re: [R] Format a dataset for use with R with chunking

2015-12-28 Thread Jeff Newmiller
Have you looked at the High Performance Computing Task View on CRAN? Whatever you do, keep in mind that the algorithms you intend to apply will have a strong impact on which data management approach is going to work best. Start small before diving in with all your data, and try successively

Re: [R] [FORGED] Mixed Beta Disrubutions

2015-12-28 Thread mesude bayrakci
Thank you for your response. I saw already that example and some others too. However, they defined alpha and beta in the examples or use two different dataset. I did not know alpha and beta values and have only one data set. I could calculate alpha and beta by using variance and means for the

Re: [R] [FORGED] Mixed Beta Disrubutions

2015-12-28 Thread Rolf Turner
On 29/12/15 12:30, mesude bayrakci wrote: Thank you for your response. I saw already that example and some others too. However, they defined alpha and beta in the examples or use two different dataset. I did not know alpha and beta values and have only one data set. I could calculate alpha and

Re: [R] [FORGED] Mixed Beta Disrubutions

2015-12-28 Thread mesude bayrakci
Hello, "Treat everyone with politeness, even those who are rude to you - not because they are nice, but because you are" The forum's name is "R-help", not "R-help for people who are experts in statistic and R". Please if you would like to help and just help. If you do not like the posts (or

Re: [R] need for help for solving operations in a vector

2015-12-28 Thread PIKAL Petr
Hi You shall send your posts to the list, others can answer your questions and not only you can benefit from their answers too. As you did not post any data it is hard to say what are your issues. I believe that there are several values which are the same not only near the peak but also at

Re: [R-es] RV: ANOVA R

2015-12-28 Thread Víctor Granda García
Aquí tienes un par de ejemplos más: http://ww2.coastal.edu/kingw/statistics/R-tutorials/repeated.html Como dice Alejandro, después de hacerlo de varias maneras (aov, modelos mixtos...) me quedo con el paquete ez (es un wrapper de anova del paquete car), que es bastante intuitivo y tiene una ayuda

Re: [R-es] Instrucciones uso rvest

2015-12-28 Thread Francisco Viciana
Creo que es mucho mas sencillo que te descargues el fichero completo con toda la serie y luego selecciones los datos que te interesa en R. Por ejemplo puedes descargar toda la serie en formato pc-Axis e importarlo con el paquete "pxR". Adjunto ejemplo:

Re: [R-es] Elecciones Generales

2015-12-28 Thread Ivan Aguilar
De aqui: http://resultadosgenerales2015.interior.es/congreso/#/ES201512-CON-ES/ES o en json: http://resultadosgenerales2015.interior.es/#/herramienta-analisis?siteLanguage=es_ES dentro del linux estan los archivos El 28 de diciembre de 2015, 16:30, Javier Marcuzzi <

Re: [R-es] Elecciones Generales

2015-12-28 Thread Karel L.
Hola Ivan, En mi opinión recurrir a "escrapear" el html no tiene demasiado sentido cuando tienes los json. Esto está en sucio, tienes que hacer un bucle que vaya recorriendo la jerarquía de directorios. Fija "data" como directorio de trabajo y borra todas las carpetas que no sean "ES".

[R-es] (sin asunto)

2015-12-28 Thread doblett
Buenas tardes, os pido ayuda sobre el siguiente tema. Tengo interes en mostrar informes con Sweave/Latex y para ello genero tablas con xtable. Sin embargo muestra la tabla al completo cuando lo que deseo es agrupar las celdas con el mismo dato para dar claridad a la tabla. La salida de xtable me

[R-es] Tablas de contingencia en latex

2015-12-28 Thread doblett
​ Buenas tardes, os pido ayuda sobre el siguiente tema. Tengo interes en mostrar informes con Sweave/Latex y para ello genero tablas con xtable. Sin embargo muestra la tabla al completo cuando lo que deseo es agrupar las celdas con el mismo dato para dar claridad a la tabla. La salida de xtable

Re: [R-es] Resumen de R-help-es, Vol 82, Envío 37

2015-12-28 Thread Pedro Concejero Cerezo
Gracias Iv�n por preguntar, a mi tambi�n me interesan esos datos para hacer un an�lisis de correspondencias con la tabla municipios por partidos. Gracias tambi�n Karel por proponer la lectura de json mediante bucle o similar, pero me temo que no funcionar�, explico por qu�. Yo me descargu� la

Re: [R-es] Resumen de R-help-es, Vol 82, Envío 37

2015-12-28 Thread Karel L.
Hola Pedro, Por suerte creo que no son códigos postales, tienen pinta de ser los código de municipios. Lo de json desagragado por municipios sería "muy duro" pero posible. Cuestión de pensarlo bien y tener en cuenta algunas excepciones. De todas formas, lo que tu necesitas es mucho más

Re: [R-es] RV: ANOVA R

2015-12-28 Thread Alejandro José Estudillo Hidalgo
Te recomiendo usar el paquete EZ. Fácil y muy intuitivo. El 28 de diciembre de 2015, 20:06, Dr. José A. Betancourt Bethencourt < josebetancourt@infomed.sld.cu> escribió: > > > Estimados > > He buscado un script para ANOVA en medidas repetidas en los paquetes aov y > easyanova y no los

[R-es] RV: ANOVA R

2015-12-28 Thread Dr. José A. Betancourt Bethencourt
Estimados He buscado un script para ANOVA en medidas repetidas en los paquetes aov y easyanova y no los encuentro �Podr�an enviarme un script para para ANOVA para medidas repetidas? Saludos y feliz 2016 Jos� (mi correo usual no funciona ahora) -- Este mensaje le ha llegado mediante el

Re: [R-es] Tablas de contingencia en latex

2015-12-28 Thread doblett
Buenos días Javier disculpa, mi nombre es Blas Molina. Coincido contigo, algo a priori sencillo me está resultando muy dificil de conseguir. Le he dado todas las vueltas posibles al paquete xtable pero no logro generar la tabla con el aspecto visual que me gustaría. El ejemplo 5.9 añade texto a