Re: [R] How to group by and get distinct rows of of grouped rows based on certain criteria

2016-07-15 Thread Satish Vadlamani
Thank you Bill and Sarah for your help. I was able to do the same with dplyr with the following code. But I could not post this since at that time my message was not posted yet. >> file1 <- select(file1, ATP.Group,Business.Event,Category) file1_1 <- file1 %>% group_by(ATP.Group,Business.Event)

Re: [R] graph: horizontal bar reflecting number of data

2016-07-15 Thread Dagmar
Ron: That was exactly what I was looking for! Thank you Ron! Also thanks to Ulrik and Jim who tried to help. I learned a lot! Dagmar Am 15.07.2016 um 12:48 schrieb Crump, Ron: Hi Dagmar, I want the names of the weeks on the x axis and the animals on the y-axis. Then, the shading of the

Re: [R] Selecting 1st and last dates from a set of dates

2016-07-15 Thread William Dunlap via R-help
A problem with finding the last but 1, or the 3rd, etc., element in a run is what to do with runs too short to have such an element. The following 2 functions just ignore such runs, so you would probably want to also drop the short runs from the output of isFirstInRun. isLastButOneInRun <-

[R] [R-pkgs] New package: corrr 0.1.0

2016-07-15 Thread Simon Jackson
Dear R users, I'm glad to announce the release of a new package on CRAN for exploring correlations in R: corrr . corrr provides a handful of methods to create and explore a correlation tbl (rather than a matrix). E.g., rearrange()

Re: [R] glmmLasso with interactions errors

2016-07-15 Thread Ben Bolker
Cade, Brian usgs.gov> writes: > > It has never been obvious to me that the lasso approach can handle > interactions among predictor variables well at all. > I'ld be curious to see > what others think and what you learn. > > Brian > For what it's worth I think lasso *does* handle

Re: [R-es] Calcular media cada x tramos

2016-07-15 Thread Carlos Ortega
Hola, Aquí, tienes varias alternativas incluyendo una muy compacta utilizando data.table al final del hilo: http://stackoverflow.com/questions/30359427/calculate-the-mean-of-every-13-rows-in-data-frame-in-r Saludos, Carlos Ortega www.qualityexcellence.es El 15 de julio de 2016, 14:49, Jesús

Re: [R-es] Calcular media cada x tramos

2016-07-15 Thread Jesús Para Fernández
No, cada curva tiene su numero de valores variable... From: c...@datanalytics.com Date: Fri, 15 Jul 2016 14:36:27 +0200 Subject: Re: [R-es] Calcular media cada x tramos To: j.para.fernan...@hotmail.com CC: r-help-es@r-project.org library(plyr) tmp <- curvastmp$grupo <- rep(rep(1:18, each = 10),

[R] Coefficients: (20 not defined because of singularities)

2016-07-15 Thread mridulgarg11
Hello Sir I came across an old post of your discussing the singularity of the model matrix, where the data matrix suffers from multicollinearity. You mentioned that using a control variable with binary indicator is a possible option for that. I wanted to ask you what is the correct remedy in

Re: [R-es] Calcular media cada x tramos

2016-07-15 Thread Carlos J. Gil Bellosta
library(plyr) tmp <- curvas tmp$grupo <- rep(rep(1:18, each = 10), times = numero_de_curvas) ddply(tmp, .(curva, grupo), media = mean(valor)) supuesto que se den ciertas condiciones (como que todas las curvas tienen 180 puntos). El 15 de julio de 2016, 14:31, Jesús Para Fernández <

[R-es] Calcular media cada x tramos

2016-07-15 Thread Jesús Para Fernández
Buenas, Estoy intentando caracterizar una curva de 180 puntos y sacar su vector de caracteristica: Punto de inicio, M�ximo Minimo Para ello tengo un dataframe con las distintas curvas, de la forma siguiente: segundos valor curva 1 1701 2

Re: [R] graph: horizontal bar reflecting number of data

2016-07-15 Thread Crump, Ron
Hi Dagmar, I want the names of the weeks on the x axis and the animals on the y-axis. Then, the shading of the barplot is supposed to represent the number of data per week. If I understand the above correctly, and using the example dataset constructed by Ulrik: datframe <-

Re: [R] graph: horizontal bar reflecting number of data

2016-07-15 Thread Jim Lemon
Hi Dagmar, Maybe your want something like this? datframe<-data.frame(Name=c("Kati","Kati","Kati","Leon","Leon","Leon" ), week =c("1","2", "3", "1","2", "3"), numberdata =c("5","12", "1", "6","2", "5")) datframe datframe$numberdata<-as.numeric(as.character(datframe$numberdat)) library(plotrix)

Re: [R] How to generate “aggregated” time lags?

2016-07-15 Thread PIKAL Petr
Hi see in line > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Faradj > Koliev > Sent: Friday, July 15, 2016 1:19 AM > To: r-help@r-project.org > Subject: [R] How to generate “aggregated” time lags? > > Dear all, > > I hope you’re enjoying your

Re: [R] graph: horizontal bar reflecting number of data

2016-07-15 Thread Ulrik Stervbo
Dear Dagmar, must the numberdata be character? Here are tew solutions. The first solution summarise before plotting and the second does everything in the plot library("dplyr") library("ggplot2") datframe <- data.frame(Name=c("Kati","Kati","Kati","Leon","Leon","Leon" ), week =c("1","2", "3",

Re: [R] graph: horizontal bar reflecting number of data

2016-07-15 Thread Dagmar
Dear all, dear Jim, Thank you for trying to help Jim. Unfortunately it didn't solve my problem. I want the names of the weeks on the x axis and the animals on the y-axis. Then, the shading of the barplot is supposed to represent the number of data per week. Any help? Dagmar Am 13.07.2016