[R] Assistant
I am Basiru Shehu by name, wishing to conduct my research base on the multivariate Behrems Fisher problems, please I need your help with a manual that I can use to analyse the data using R. Thanks so much. [[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 posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] [R-pkgs] packageRank (v.0.3.0) update
packageRank: compute and visualize package download counts and rank percentiles * compute and visualize the counts and ranks (nominal and percentile) of downloads from RStudio's CRAN mirror and Bioconductor. * compute and visualize a package's position in the overall distribution of download counts for a given day (cross-sectionally) or over time (longitudinally). * compute and visualize the downloads of the R application. CRAN: https://cran.r-project.org/package=packageRank GitHub: https://github.com/lindbrook/packageRank [[alternative HTML version deleted]] ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] ggpubr: order of non-numeric x-axis items
Yes , thanks Deepayan. Darn! -- I've committed this error in the past, also, but keep forgetting. Sigh... the aging brain. -- 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 Sat, Oct 26, 2019 at 8:55 AM Deepayan Sarkar wrote: > On Sat, Oct 26, 2019 at 8:22 PM Bert Gunter > wrote: > > > > No. relevel() only changes the order in one specific way. Use > `levels<-`() > > to reorder in a general way: > > > > > z <- factor(rep(letters[3:1],2)) > > > z > > [1] c b a c b a > > Levels: a b c > > > z <-relevel(z, ref = "c") > > > z > > [1] c b a c b a > > Levels: c a b > > > levels(z)<- c("c","b","a") > > > z > > [1] c a b c a b > > Levels: c b a > > No, that changes the data, not just the order of the levels; "b" and > "a" have been switched. > > You need some version of > > > factor(z, levels = c("c", "a", "b")) > [1] c b a c b a > > See also ?reorder for a useful way of reordering the levels, > especially in plots. > > -Deepayan > > > Cheers, > > 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 Sat, Oct 26, 2019 at 6:09 AM Patrick (Malone Quantitative) < > > mal...@malonequantitative.com> wrote: > > > > > Try using relevel() to organize the categories in your factor in the > > > desired order. You may need to use relevel(as.factor()) . > > > > > > On Sat, Oct 26, 2019 at 6:51 AM April Ettington > > > wrote: > > > > > > > > Hi, > > > > > > > > When I use ggpubr with an x-axis utilizing descriptive categories > (eg. > > > bar > > > > chart for different colors of car), it sorts all of the labels > > > > alphabetically. Is there a way to change this so it shows in the > order I > > > > want? > > > > > > > > Thanks, > > > > > > > > April > > > > > > > > [[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 posting guide > > > http://www.R-project.org/posting-guide.html > > > > and provide commented, minimal, self-contained, reproducible code. > > > > > > __ > > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > > https://stat.ethz.ch/mailman/listinfo/r-help > > > PLEASE do read the posting guide > > > http://www.R-project.org/posting-guide.html > > > and provide commented, minimal, self-contained, reproducible code. > > > > > > > [[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 posting guide > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > [[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 posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] ggpubr: order of non-numeric x-axis items
Thanks, both of you. On Sat, Oct 26, 2019 at 11:55 AM Deepayan Sarkar wrote: > > On Sat, Oct 26, 2019 at 8:22 PM Bert Gunter wrote: > > > > No. relevel() only changes the order in one specific way. Use `levels<-`() > > to reorder in a general way: > > > > > z <- factor(rep(letters[3:1],2)) > > > z > > [1] c b a c b a > > Levels: a b c > > > z <-relevel(z, ref = "c") > > > z > > [1] c b a c b a > > Levels: c a b > > > levels(z)<- c("c","b","a") > > > z > > [1] c a b c a b > > Levels: c b a > > No, that changes the data, not just the order of the levels; "b" and > "a" have been switched. > > You need some version of > > > factor(z, levels = c("c", "a", "b")) > [1] c b a c b a > > See also ?reorder for a useful way of reordering the levels, > especially in plots. > > -Deepayan > > > Cheers, > > 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 Sat, Oct 26, 2019 at 6:09 AM Patrick (Malone Quantitative) < > > mal...@malonequantitative.com> wrote: > > > > > Try using relevel() to organize the categories in your factor in the > > > desired order. You may need to use relevel(as.factor()) . > > > > > > On Sat, Oct 26, 2019 at 6:51 AM April Ettington > > > wrote: > > > > > > > > Hi, > > > > > > > > When I use ggpubr with an x-axis utilizing descriptive categories (eg. > > > bar > > > > chart for different colors of car), it sorts all of the labels > > > > alphabetically. Is there a way to change this so it shows in the order > > > > I > > > > want? > > > > > > > > Thanks, > > > > > > > > April > > > > > > > > [[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 posting guide > > > http://www.R-project.org/posting-guide.html > > > > and provide commented, minimal, self-contained, reproducible code. > > > > > > __ > > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > > https://stat.ethz.ch/mailman/listinfo/r-help > > > PLEASE do read the posting guide > > > http://www.R-project.org/posting-guide.html > > > and provide commented, minimal, self-contained, reproducible code. > > > > > > > [[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 posting guide http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R-es] Duda de como contar casos por Programa.
Hola, Lo puedes resolver de esta forma... He comentado el código para que puedas seguir el resultado de cada etapa. # library(randomNames) library(dplyr) library(tidyr) # Genero nombres aleatorios de "pacientes". ## - Estos son algunos de los que coincidirian nom_coin <- randomNames(50, ethnicity = 4) ## - A los que coincidirian les anado otros puramente aleatorios mis_datos <- data.frame( prog_A = sample(c(nom_coin, randomNames(70, ethnicity = 1)), 100, replace = FALSE), prog_B = sample(c(nom_coin, randomNames(70, ethnicity = 1)), 100, replace = FALSE), prog_C = sample(c(nom_coin, randomNames(70, ethnicity = 1)), 100, replace = FALSE), prog_D = sample(c(nom_coin, randomNames(70, ethnicity = 1)), 100, replace = FALSE) ) # - Construyo las combinaciones dos a dos de las columnas res_cols <- as.data.frame(t(combn(names(mis_datos), 2))) res_comb <- as.data.frame(t(combn(1:ncol(mis_datos), 2))) res_tot <- cbind(res_cols, res_comb) # - Comparo las parejas de columnas for(i in 1:nrow(res_tot)) { val_inter <- intersect(mis_datos[, res_comb[i,1]], mis_datos[, res_comb[i,2]]) res_tot[i, 5] <- length(val_inter) } res_out <- res_tot[, c(1,2,5)] names(res_out)[3] <- c('Qty') # - Construyo la tabla final res_table <- res_out %>% pivot_wider(names_from = V2, values_from = Qty ) res_table # Saludos, Carlos Ortega www.qualityexcellence.es El vie., 25 oct. 2019 a las 20:17, juan manuel dias () escribió: > Hola, > > Tengo un tabla de datos con pacientes asistidos, para los cuáles tengo > variables como dni, género, programa de atención etc. Hay pacientes que > atendieron en más de un programa por lo cuál se repiten en la tabla. Lo que > quiero es poder contar con una matriz que me permita identificar la > cantidad de pacientes que coinciden entre programas. > > Va un ejemplo: > > [image: image.png] > Intenté de varias formas pero no consigo hacerlo. > > Muchas gracias! > > Saludos. > ___ > R-help-es mailing list > R-help-es@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-help-es > -- Saludos, Carlos Ortega www.qualityexcellence.es ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
Re: [R] ggpubr: order of non-numeric x-axis items
On Sat, Oct 26, 2019 at 8:22 PM Bert Gunter wrote: > > No. relevel() only changes the order in one specific way. Use `levels<-`() > to reorder in a general way: > > > z <- factor(rep(letters[3:1],2)) > > z > [1] c b a c b a > Levels: a b c > > z <-relevel(z, ref = "c") > > z > [1] c b a c b a > Levels: c a b > > levels(z)<- c("c","b","a") > > z > [1] c a b c a b > Levels: c b a No, that changes the data, not just the order of the levels; "b" and "a" have been switched. You need some version of > factor(z, levels = c("c", "a", "b")) [1] c b a c b a See also ?reorder for a useful way of reordering the levels, especially in plots. -Deepayan > Cheers, > 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 Sat, Oct 26, 2019 at 6:09 AM Patrick (Malone Quantitative) < > mal...@malonequantitative.com> wrote: > > > Try using relevel() to organize the categories in your factor in the > > desired order. You may need to use relevel(as.factor()) . > > > > On Sat, Oct 26, 2019 at 6:51 AM April Ettington > > wrote: > > > > > > Hi, > > > > > > When I use ggpubr with an x-axis utilizing descriptive categories (eg. > > bar > > > chart for different colors of car), it sorts all of the labels > > > alphabetically. Is there a way to change this so it shows in the order I > > > want? > > > > > > Thanks, > > > > > > April > > > > > > [[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 posting guide > > http://www.R-project.org/posting-guide.html > > > and provide commented, minimal, self-contained, reproducible code. > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > > [[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 posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] ggpubr: order of non-numeric x-axis items
No. relevel() only changes the order in one specific way. Use `levels<-`() to reorder in a general way: > z <- factor(rep(letters[3:1],2)) > z [1] c b a c b a Levels: a b c > z <-relevel(z, ref = "c") > z [1] c b a c b a Levels: c a b > levels(z)<- c("c","b","a") > z [1] c a b c a b Levels: c b a Cheers, 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 Sat, Oct 26, 2019 at 6:09 AM Patrick (Malone Quantitative) < mal...@malonequantitative.com> wrote: > Try using relevel() to organize the categories in your factor in the > desired order. You may need to use relevel(as.factor()) . > > On Sat, Oct 26, 2019 at 6:51 AM April Ettington > wrote: > > > > Hi, > > > > When I use ggpubr with an x-axis utilizing descriptive categories (eg. > bar > > chart for different colors of car), it sorts all of the labels > > alphabetically. Is there a way to change this so it shows in the order I > > want? > > > > Thanks, > > > > April > > > > [[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 posting guide > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[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 posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] ggpubr: order of non-numeric x-axis items
Try using relevel() to organize the categories in your factor in the desired order. You may need to use relevel(as.factor()) . On Sat, Oct 26, 2019 at 6:51 AM April Ettington wrote: > > Hi, > > When I use ggpubr with an x-axis utilizing descriptive categories (eg. bar > chart for different colors of car), it sorts all of the labels > alphabetically. Is there a way to change this so it shows in the order I > want? > > Thanks, > > April > > [[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 posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] ggpubr: order of non-numeric x-axis items
Hi, When I use ggpubr with an x-axis utilizing descriptive categories (eg. bar chart for different colors of car), it sorts all of the labels alphabetically. Is there a way to change this so it shows in the order I want? Thanks, April [[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 posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Matching Values issue
Hello, That's a floating-point issue. See FAQ 7.31. See also [1], [2] and the links therein. [1] https://stackoverflow.com/questions/9508518/why-are-these-numbers-not-equal [2] https://stackoverflow.com/questions/588004/is-floating-point-math-broken Hope this helps, Rui Barradas Às 10:00 de 25/10/19, Roberto Martinez Caballero escreveu: __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.