[R] UpSetR

2016-04-19 Thread Evan Kransdorf
Hello, Does anyone use UpSetR for set visualization? I am wanting to re-order the sets in the diagram. Thanks, Evan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] Interquartile Range

2016-04-19 Thread Michael Artz
I already found a solution, you suggested I try to find a non hacky solution, which was not really my priority. I should have declined politely, which I will do now. Or, ifyou just want me to post reproducible code because you are bored or because you like solving problems then let me know and I

Re: [R] Creating two new variables conditional on retaining values from previous rows

2016-04-19 Thread Jim Lemon
Hi pele, There are probably more elegant ways to do this using some function, but this might help: psdat<-read.table(text="ID DATE ITEM 1 1/1/2014P1 1 1/15/2014 P2 1 1/20/2014 P3 1 1/22/2014 P4 1 3/10/2015 P5 2 1/13/2015 P1 2 1/20/2015 P2 2 1/28/2015 P3

Re: [R] Interquartile Range

2016-04-19 Thread Bert Gunter
??? IQR returns a single number. > IQR(rnorm(10)) [1] 1.090168 To your 2nd response: "I could have used average, min, max, they all would have returned the same thing., " I can only respond: huh?? Are all your values identical? You really need to provide a small reproducible example as

[R] XLConnect Package

2016-04-19 Thread Keith S Weintraub
Folks, I am using the XLConnect package. I can download all the named ranges except a couple that are defined by the Excel function “Offset”. For example I have this named range: =OFFSET(APA!$A$1,0,0,APA!$K$11,3) I am pretty sure that this won’t work but I thought I would give it a shot

Re: [R] Interquartile Range

2016-04-19 Thread Michael Artz
Again, IQR returns two both a .25 and a .75 value and it failed, which is why I didn't use it before. Also, the first function just returns tha same value repeating. Since they are the same, before the second call, using the mode function is just a way to grab one value. I could have used

Re: [R] Interquartile Range

2016-04-19 Thread Marc Schwartz
Hi, Jumping into this thread mainly on the point of the mode of the distribution, while also supporting Bert's comments below on theory. If the vector 'x' that is being passed to this function is an integer vector, then a tabulation of the integers can yield a 'mode', presuming of course that

Re: [R] Creating two new variables conditional on retaining values from previous rows

2016-04-19 Thread Bert Gunter
I do not have the tenacity to decipher your logic, but I would suggest that you go through an R tutorial or two instead of limiting yourself to R-Help (not R forum?) archives. You probably are going about it wrongly in R (I suspect you need indexing). In fact, I would guess that you probably don't

[R-es] Script sin resultados

2016-04-19 Thread Manuel Máquez
Carlos: Te agradezco mucho tu respuesta tan rápida. Se trata de obtener las incidencias en cada uno de los 39 grupos, aquellos que lo hacen con mayor frecuencia. Es decir del grupo 'n' cuántas veces sucede 1, 2, ... hasta 10. Con este resumen que va ir cambiando, aplicarle loess. Por lo que se

Re: [R] Interquartile Range

2016-04-19 Thread Bert Gunter
Well, instead of your functions try: Mode <- function(x) { tabx <- table(x) tabx[which.max(tabx)] } and use R's IQR function instead of yours. ... so I still don't get why you want to return a character string instead of a value for the IQR; and the mode of a sample defined as above

[R] Creating two new variables conditional on retaining values from previous rows

2016-04-19 Thread pele.s--- via R-help
Hello, Iam looking for an R solution that can efficiently produce the output shown below. I can produce this easily in SAS with retain statement and a few lines of if-then-else logic, etc.. but I am not find anything similar on the Rforum archives. Below is the logic I am trying to apply to

Re: [R] Interquartile Range

2016-04-19 Thread Michael Artz
Hi, Here is what I am doing notGroupedAll <- ddply(data ,~groupColumn ,summarise ,col1_mean=mean(col1) ,col2_mode=Mode(col2) #Function I wrote for getting the mode shown below ,col3_Range=myIqr(col3)

Re: [R-es] Script sin resultados completos

2016-04-19 Thread Carlos Ortega
Hola, Te comento varias cosas: - No obtengo ningún tipo de error, ni warning al ejecutar el script. - Los resultados que obtengo de smas[,2] y smas[,3] son diferentes a los que obtienes en los dos casos (el bueno y el malo). > smas[,2] [1] 17 NA 5 7 NA NA NA NA NA NA 17 NA 5 7 NA

Re: [R] Merge sort

2016-04-19 Thread Duncan Murdoch
On 19/04/2016 3:39 PM, Gaston wrote: Hello everyone, I am learning R since recently, and as a small exercise I wanted to write a recursive mergesort. I was extremely surprised to discover that my sorting, although operational, is deeply inefficient in time. Here is my code : merge <-

[R] Merge sort

2016-04-19 Thread Gaston
Hello everyone, I am learning R since recently, and as a small exercise I wanted to write a recursive mergesort. I was extremely surprised to discover that my sorting, although operational, is deeply inefficient in time. Here is my code : > merge <- function(x,y){ > if (is.na(x[1]))

[R] Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?

2016-04-19 Thread Henrik Bengtsson
Using the Matrix package, how can I create a row-oriented sparse Matrix from scratch populated with some data? By default a column-oriented one is created and I'm aware of the note that the package is optimized for column-oriented ones, but I'm only interested in using it for holding my sparse

Re: [R] installation of dplyr

2016-04-19 Thread Ben Tupper
Hi, OK - that can be fixed by our IT whizzes. Thanks, Ben P.S. Thanks for dplyr! > On Apr 19, 2016, at 4:10 PM, Hadley Wickham wrote: > > You normally see these errors when compiling on a vm that has very > little memory. > Hadley > > On Tue, Apr 19, 2016 at 2:47 PM,

Re: [R] installation of dplyr

2016-04-19 Thread Hadley Wickham
You normally see these errors when compiling on a vm that has very little memory. Hadley On Tue, Apr 19, 2016 at 2:47 PM, Ben Tupper wrote: > Hello, > > I am getting a fresh CentOS 6.7 machine set up with all of the goodies for R > 3.2.3, including dplyr package. I am

Re: [R] Interquartile Range

2016-04-19 Thread William Dunlap via R-help
If you show us, not just tell us about, a self-contained example someone might show you a non-hacky way of getting the job done. (I don't see an argument to plyr::ddply called 'transform'.) Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Apr 19, 2016 at 12:18 PM, Michael Artz

[R] installation of dplyr

2016-04-19 Thread Ben Tupper
Hello, I am getting a fresh CentOS 6.7 machine set up with all of the goodies for R 3.2.3, including dplyr package. I am unable to successfully install it. Below I show the failed installation using utils::install.packages() and then again using devtools::install_github(). Each yields an

Re: [R] Interquartile Range

2016-04-19 Thread Michael Artz
Oh thanks for that clarification Bert! Hope you enjoyed your coffee! I ended up just using the transform argument in the ddply function. It worked and it repeated, then I called a mode function in another call to ddply that summarised. Kinda hacky but oh well! On Tue, Apr 19, 2016 at 12:31

Re: [R] Problem with X11

2016-04-19 Thread klerer
Dear Lorenzo, Dear R list,[a] to all recipients: sorry, this email is html-against my own believes and because of inevitable constraints so far.[b] to Lorenzo: "...and I have recently update my R environment" sounds as that would be a gift of heaven! How did you manage to update and how exactly

Re: [R] Problem with X11

2016-04-19 Thread Tom Wright
I don't have my debian box available so can't confirm. But I would try $apt-get install libpng On Tue, Apr 19, 2016 at 11:23 AM, Lorenzo Isella wrote: > Dear All, > I have never had this problem before. I run debian testing on my box > and I have recently update my R

[R-es] Script sin resultados completos

2016-04-19 Thread Manuel Máquez
Hola Colegas: Tengo el siguiente script donde no se en donde esta el error, ojalá que alguno de ustedes me pueda ayudar. Anticipo las gracias más cumplidas por anticipado. bas <- read.csv('TAB.csv', header = F) sv <- 0 sm <- 0 lg <- 0 smas <- matrix (1:390) for (i in 1:39) { # if (i == 8)

Re: [R] Interquartile Range

2016-04-19 Thread Bert Gunter
... and I'm getting another cup of coffee... -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Apr 19, 2016 at 10:30 AM, Bert Gunter

Re: [R] Interquartile Range

2016-04-19 Thread Bert Gunter
NO NO -- I am wrong! The paste() expression is of course evaluated. It's just that a character string is returned of the form "something - something". I apologize for the confusion. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking

Re: [R] Interquartile Range

2016-04-19 Thread Bert Gunter
To be precise: paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") is an expression that evaluates to a character string: "round(quantile(x,.25),0) - round(quantile(x,0.75),0)" no matter what the argument of your function, x. Hence return(paste(...)) will return this exact

Re: [R] Interquartile Range

2016-04-19 Thread William Dunlap via R-help
Can you show us a self-contained example, along with the output of running conflicts()? Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Apr 19, 2016 at 8:57 AM, Michael Artz wrote: > HI that did not work for me either. The value I got returned from that > function

Re: [R] Interquartile Range

2016-04-19 Thread Michael Artz
HI that did not work for me either. The value I got returned from that function was " - " :(. thanks for the reply through On Tue, Apr 19, 2016 at 10:34 AM, William Dunlap wrote: > > That didn't work Jim! > > It always helps to say how the suggestion did not work. Jim's >

Re: [R] Problem with X11

2016-04-19 Thread Rainer Schuermann
Probably wrong list, but anyway: Same problem here, after a apt-get dist-upgrade On Tuesday, April 19, 2016 05:23:37 PM Lorenzo Isella wrote: > Dear All, > I have never had this problem before. I run debian testing on my box > and I have recently update my R environment. > Now, see what

Re: [R] Interquartile Range

2016-04-19 Thread William Dunlap via R-help
> That didn't work Jim! It always helps to say how the suggestion did not work. Jim's function had a typo in it - was that the problem? Or did you not change the call to ddply to use that function. Here is something that might "work" for you: library(plyr) data <-

Re: [R] Interquartile Range

2016-04-19 Thread Michael Artz
Hi bert, I understand the difference between a character string and a number. I need to return a character string, that is a requirement. It needs to be in that format. Getting the range with IQR is trivial I already tried it. The grouping function accepts only one return value, and IQR

[R] Problem with X11

2016-04-19 Thread Lorenzo Isella
Dear All, I have never had this problem before. I run debian testing on my box and I have recently update my R environment. Now, see what happens when I try the most trivial of all plots plot(seq(22)) Error in (function (display = "", width, height, pointsize, gamma, bg, : X11 module cannot

Re: [R] Interquartile Range

2016-04-19 Thread Bert Gunter
Are you aware that there *already is* a function that does this? ?IQR (also your "function" iqr" is just a character string and would have to be parsed and evaluated to become a function. But this is a TERRIBLE way to do things in R as it completely circumvents R's central functional programming

Re: [R] Interquartile Range

2016-04-19 Thread Michael Artz
That didn't work Jim! Thanks anyway On Mon, Apr 18, 2016 at 9:02 PM, Jim Lemon wrote: > Hi Michael, > At a guess, try this: > > iqr<-function(x) { > return(paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") > } > > .col3_Range=iqr(datat$tenure) > > Jim >

Re: [R] Indicator Species analysis; trouble with multipatt

2016-04-19 Thread John Kane
Hi Ansley It looks good to me but I did not run the analysis as I am too lazy to install "indicspecies". The inclusion of the raw data is a great help. John Kane Kingston ON Canada -Original Message- From: daily.p...@gmail.com Sent: Tue, 19 Apr 2016 08:16:54 -0400 To:

Re: [R] Indicator Species analysis; trouble with multipatt

2016-04-19 Thread Ansley Silva
Thanks for the replies. I have fixed the problem. I only need to reorganized my data. Now my question is about asking questions correctly. I hope I've got it. Please find the script attached here. R Version 3.2.2 I am looking for indicator species with Indicspecies package. After running

Re: [R] heatmap2 error key

2016-04-19 Thread Jim Lemon
Hi Catalina, The error message is pretty clear. min(diff(breaks)/100) evaluates to a negative number. Perhaps the sort order for the values in "breaks" has changed. Jim On Tue, Apr 19, 2016 at 9:35 AM, Catalina Aguilar Hurtado wrote: > Hi I am trying to understand what

Re: [R] heatmap2 error key

2016-04-19 Thread John Kane
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: cata...@gmail.com > Sent: Tue, 19 Apr 2016 09:35:14 +1000 >

Re: [R] Indicator Species analysis; trouble with multipatt

2016-04-19 Thread John Kane
Hi Ansely, As Jim points out we really need some sample data to go with the code. Have a look at ?dput which is the best way to supply sample data here or have a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or

Re: [R] A Neural Network question

2016-04-19 Thread Charles Determan
Hi Phil, I don't think this is the correct list for this. You question has nothing to do with R specifically which is the purpose here. I suggest you pursue other help lists related to neural networks to try and find someone to assist you. Regards, Charles On Sat, Apr 16, 2016 at 2:08 AM,

[R] heatmap2 error key

2016-04-19 Thread Catalina Aguilar Hurtado
Hi I am trying to understand what happen with the heatmap.2 code that it used to work (last used in October 2015). I am able to get a heatmap but my colour key doesn't come up and instead I get an error in all my files the used to work. Does anyone has any idea of what could have changed? or how

[R] (Small) programming job related to network analysis

2016-04-19 Thread Michael Haenlein
Dear all, I am looking for help in programming three functions. Those functions should simulate (social) networks according to the process described in : (1) A.H. Dekker - "Realistic Social Networks for Simulation using Network Rewiring" (