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 ba

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 <- functio

[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() the

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 interactio

[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 c

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 <- data.frame(Name=c(

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) ba

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 summe

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", "1",

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