Re: [R] loop for comparing two or more groups using bootstrapping

2018-09-11 Thread Marna Wagley
Thank you Jim, it worked. I am very grateful for your help. Thanks KG On Tue, Sep 11, 2018 at 3:51 PM Jim Lemon wrote: > Hi Kristi, > My fault, I only worked out how to assign the values to the names and pick > out the columns of daT for the calculations. I think this does what you > want, but

[R] Correcting dates in research / medical record using R

2018-09-11 Thread Nicola Cecchino
Hi, I'm not that well versed with R - I'm trying to correct the dates of service in a de-identified research medical record of several subjects.  The correct dates come from a csv file, in the VisitDate column,  that looks like this in Excel.  The empty cells have other data in them that I

Re: [R] Undesired tick marks on top, right axes [RESOLVED]

2018-09-11 Thread Rich Shepard
On Tue, 11 Sep 2018, Bert Gunter wrote: You do that. Your error is obvious. Bert, Yep. Forgot to remove the 'p' from the type attribute. Mea culpa! Rich __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] Undesired tick marks on top, right axes

2018-09-11 Thread Bert Gunter
You do that. Your error is obvious. -- Bert On Tue, Sep 11, 2018 at 5:39 PM Rich Shepard wrote: > > On Tue, 11 Sep 2018, Bert Gunter wrote: > > > As I thought, you did not do what I told you to. > > Look *carefully* at the two to see your error. > > Bert, > >You're correct, of course. After

Re: [R] Undesired tick marks on top, right axes

2018-09-11 Thread Rich Shepard
On Tue, 11 Sep 2018, Bert Gunter wrote: As I thought, you did not do what I told you to. Look *carefully* at the two to see your error. Bert, You're correct, of course. After moving the tck parameter in front of the x list the right-side ticks are gone. Unfortunately, so are the data: the

Re: [R] Undesired tick marks on top, right axes

2018-09-11 Thread Bert Gunter
As I thought, you did not do what I told you to. Look *carefully* at the two to see your error. -- Bert On Tue, Sep 11, 2018 at 5:01 PM Rich Shepard wrote: > > On Tue, 11 Sep 2018, Bert Gunter wrote: > > > Not when I run your code with the tck specification added. Show us > > your xyplot

Re: [R] Undesired tick marks on top, right axes

2018-09-11 Thread Rich Shepard
On Tue, 11 Sep 2018, Bert Gunter wrote: Not when I run your code with the tck specification added. Show us your xyplot invocation. It should be scales = list(tck = c(1,0), x= etc.) Bert, Command: rain.all.sum <- xyplot(Sum ~ Month, data=agg.all, col = 'black', type = 'h',

Re: [R] Hierarchical Cluster Analysis

2018-09-11 Thread Jim Lemon
agnes (cluster) Jim On Wed, Sep 12, 2018 at 8:10 AM Bryan Mac wrote: > > > Bryan Mac > Data Scientist > Research Analytics > Ipsos Insight LLC > > > > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To

Re: [R] Undesired tick marks on top, right axes

2018-09-11 Thread Bert Gunter
?? Not when I run your code with the tck specification added. Show us your xyplot invocation. It should be scales = list(tck = c(1,0), x= etc.) Bert On Tue, Sep 11, 2018 at 3:51 PM Rich Shepard wrote: > > On Tue, 11 Sep 2018, Bert Gunter wrote: > > > Adding > > tck = c(1, 0) > > to the "scales

Re: [R] Remove plot axis values in dotplot graph

2018-09-11 Thread Jim Lemon
Hi Abou, Surprisingly you can't omit the x axis in dotchart. This hack will work: sink("dotchar_noax.R") sink() Edit the resulting file by joining the first two lines with the assignment symbol (<-), delete the two lines at the bottom and comment out the line "axis(1)".

Re: [R] Increasing size of label in Taylor plot of Plotrix package

2018-09-11 Thread Jim Lemon
Hi Sonam, You're right. Although the cex.axis argument is present, it doesn't seem to be used. I will have to debug this, which may take a day or two. Jim On Tue, Sep 11, 2018 at 6:37 PM Sonam Sandeep Dash wrote: > > Respected Sir, > I have created a Taylor plot using the plotrix package.

Re: [R] loop for comparing two or more groups using bootstrapping

2018-09-11 Thread Jim Lemon
Hi Kristi, My fault, I only worked out how to assign the values to the names and pick out the columns of daT for the calculations. I think this does what you want, but I can't guarantee the result. daT<-structure(list(year1=c(0.417,0.538,0.69,0.688,0.688,0.606,

Re: [R] Undesired tick marks on top, right axes

2018-09-11 Thread Rich Shepard
On Tue, 11 Sep 2018, Bert Gunter wrote: Adding tck = c(1, 0) to the "scales =" list will probably solve your problem. Bert, How interesting. This removed the tick marks on top but left them on the right axes. Will think more about this. Regards, Rich

Re: [R] getting 21 very different colours

2018-09-11 Thread Achim Zeileis
Have a look at the Polychrome package by Kevin Coombes and Guy Brock: https://CRAN.R-project.org/package=Polychrome This employs the LUV space (with HCL = polar LUV) to get many distinct distinguishable colors. For a few first steps, see:

Re: [R] Undesired tick marks on top, right axes

2018-09-11 Thread Rich Shepard
On Tue, 11 Sep 2018, Bert Gunter wrote: Well, you might try ?xyplot -- in particular the "scales" list section and in particular there the "tck" parameter. Adding tck = c(1, 0) to the "scales =" list will probably solve your problem. Bert, I missed the end of the tck description in the

Re: [R] getting 21 very different colours

2018-09-11 Thread Zach Simpson
Hi Federico For a possible alternative, the scico package provides a nice collection of color palettes that are designed to be both color-blind friendly and differentiable: https://www.data-imaginist.com/2018/scico-and-the-colour-conundrum/ You could generate a vector of 21 colors (spaced as

Re: [R] Undesired tick marks on top, right axes

2018-09-11 Thread Bert Gunter
Well, you might try ?xyplot -- in particular the "scales" list section and in particular there the "tck" parameter. Adding tck = c(1, 0) to the "scales =" list will probably solve your problem. -- Bert On Tue, Sep 11, 2018 at 2:46 PM Rich Shepard wrote: > >Every lattice xyplot() I've

[R] Hierarchical Cluster Analysis

2018-09-11 Thread Bryan Mac
Bryan Mac Data Scientist Research Analytics Ipsos Insight LLC [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Undesired tick marks on top, right axes

2018-09-11 Thread Rich Shepard
Every lattice xyplot() I've created before this one has tick marks on only the left and bottom axes. The current plot has sprouted tick marks on the top and right side, too, and I want to remove them. I've not found an answer to this issue in Deepayan's book or on the web. I would appreciate

[R] Remove plot axis values in dotplot graph

2018-09-11 Thread AbouEl-Makarim Aboueissa
Dear All: One more thing. I want to Remove the plot x-axis values in dotplot graph. I am trying to use xaxt = "n", but it seems NOT working. Also after removing the x-axis values, I want to use the command axis(1, at=0:16, cex.axis=1) to add x-axis values from 0 to 16, but it seems not working as

Re: [R] Bar Graph

2018-09-11 Thread AbouEl-Makarim Aboueissa
Dear Rui: thank you very much abou __ *AbouEl-Makarim Aboueissa, PhD* *Professor of Statistics* *Graduate Coordinator* *Department of Mathematics and Statistics* *University of Southern Maine* On Tue, Sep 11, 2018 at 2:24 PM Rui Barradas wrote: > Hello, > > Use

Re: [R] Bar Graph

2018-09-11 Thread AbouEl-Makarim Aboueissa
Dear Bert: thank you very much abou __ *AbouEl-Makarim Aboueissa, PhD* *Professor of Statistics* *Graduate Coordinator* *Department of Mathematics and Statistics* *University of Southern Maine* On Tue, Sep 11, 2018 at 2:47 PM Bert Gunter wrote: > Not quite -- he

Re: [R] [FORGED] Re: getting 21 very different colours

2018-09-11 Thread Paul Murrell
You could also take a look at the 'Polychrome' package Paul On 12/09/18 03:36, Barry Rowlingson wrote: On Tue, Sep 11, 2018 at 11:43 AM, Duncan Murdoch wrote: On 11/09/2018 3:34 AM, Federico Calboli wrote: Hi All, I am plotting a scatterplot of 21 populations, and I am using

Re: [R] Bar Graph

2018-09-11 Thread Bert Gunter
Not quite -- he wanted the frequencies not the counts. So something like this (using the adj argument to center the frequencies above each bar: bp <-barplot(Number.of.Death, names.arg=Cause.of.Death, main="Bar Graph for Death Data", ylab="Number of Deaths", xlab="Cause of Death", ylim = c(0,500)

Re: [R] Bar Graph

2018-09-11 Thread Rui Barradas
Hello, Use function text() with the return of barplot() as x value and Number.of.Death as y. Note that the limits of the y axis are not the automatic ones. bp <- barplot(Number.of.Death, names.arg=Cause.of.Death, main="Bar Graph for Death Data", ylab="Number of Death", xlab="Cause of

[R] Bar Graph

2018-09-11 Thread AbouEl-Makarim Aboueissa
Dear All: I do need your help on how to add frequency to bar plot on the top of each bar. here is the R code. *Number.of.Death <- c(432, 217,93, 34, 224)# Number of Death* *Cause.of.Death <- c("Heart disease", "Cancer", "Stroke", "Accidents", "Other") * *barplot(Number.of.Death,

Re: [R] getting 21 very different colours

2018-09-11 Thread Barry Rowlingson
On Tue, Sep 11, 2018 at 11:43 AM, Duncan Murdoch wrote: > On 11/09/2018 3:34 AM, Federico Calboli wrote: > > Hi All, > > > > I am plotting a scatterplot of 21 populations, and I am using > rainbow(21)[pops.col] to generate 21 colours for the plot (which works). > Maybe it is because I can really

Re: [R] For loop with multiple iteration indexes

2018-09-11 Thread David L Carlson
Just for fun, there are ways to do this in R without an explicit loop: > set.seed(42) > dat <- matrix(rnorm(10*5), 10, 5) > x <- sample(1:5) > y <- sample(1:5) > diag(cor(dat[, x], dat[, y])) [1] -0.69156568 -0.06002371 -0.37492894 0.46477742 -0.37972866 You can use as.list() to convert the

Re: [R] loop for comparing two or more groups using bootstrapping

2018-09-11 Thread Kristi Glover
Dear Jim, Thank you very much for the code. I run it but it gave me row names like "year224", "year142". are these the difference between columns? If we want to get bootstrapping means of difference between years (year2-year1; year3-year1), its CI and exact p value, how can we get it? thanks

[R] Problem with lm.resid() when weights are provided

2018-09-11 Thread Hamed Ha
Dear R Help Team. I get some weird results when I use the lm function with weight. The issue can be reproduced by the example below: The input data is (weights are intentionally designed to reflect some structures in the data) > df y x weight 1.51156139 0.55209240 2.117337e-34 -0.63653132

Re: [R] getting 21 very different colours

2018-09-11 Thread Duncan Murdoch
On 11/09/2018 3:34 AM, Federico Calboli wrote: Hi All, I am plotting a scatterplot of 21 populations, and I am using rainbow(21)[pops.col] to generate 21 colours for the plot (which works). Maybe it is because I can really process few colours at a time, but the differences between the

Re: [R] getting 21 very different colours

2018-09-11 Thread Ivan Krylov
On Tue, 11 Sep 2018 07:34:51 + Federico Calboli wrote: > Is there a way of getting a set of 21 colours that maximises the > differences between them? In my limited experience, getting even 10 colours to look different enough is a serious undertaking. Take a look at RColorBrewer:

Re: [R] getting 21 very different colours

2018-09-11 Thread S Ellison
You could look at combning a number of palettes from the RColorBrewer package to get the palette length you want. S Ellison > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Federico > Calboli > Sent: 11 September 2018 08:35 > To:

[R] getting 21 very different colours

2018-09-11 Thread Federico Calboli
Hi All, I am plotting a scatterplot of 21 populations, and I am using rainbow(21)[pops.col] to generate 21 colours for the plot (which works). Maybe it is because I can really process few colours at a time, but the differences between the colours are not as strong as I’d like. I can specify

Re: [R] loop for comparing two or more groups using bootstrapping

2018-09-11 Thread Jim Lemon
Hi Kristy, Try this: colname.mat<-combn(paste0("year",1:4),2) samplenames<-apply(colname.mat,2,paste,collapse="") k<-1 for(column in 1:ncol(colname.mat)) { assign(samplenames[column],replicate(k,sample(unlist(daT[,colname.mat[,column]]),3,TRUE))) } Then use get(samplenames[1]) and so on to