[R] remove last char of a text string
Dear R experts, is there a simple way to remove the last char of a text string? substr() function use as parameter start end only... but my strings are of different length... 01asap05a - 01asap05 02ee04b - 02ee04 Thank you all, Gianandrea -- View this message in context: http://r.789695.n4.nabble.com/remove-last-char-of-a-text-string-tp2254377p2254377.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] From xtabs to matrix
Hi list, is it possible convert the xtabs result xtabs(breaks~tension+wool,data=warpbreaks) wool tension A B L 401 254 M 216 259 H 221 169 to a simple matrix? A B L 401 254 M 216 259 H 221 169 Thanks a lot! Gianandrea -- View this message in context: http://www.nabble.com/From-xtabs-to-matrix-tp24304588p24304588.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] Self Organizing Map
Dear list, I really appreciate previous suggestion about self organizing map. I tried to perform SOM analyses with kohonen, som and class packages, but it's not clear to me if these packages are complete to: 1) cluster neurons according to their similarities (U-matrix); 2) assign to SOM neurons variables names; 3) define the importance of each variable, like in figures 2,3 and 5 of http://dx.doi.org/10.1016/j.ecolmodel.2005.10.044 for example. Thanks so much! Sincerely, Gianandrea -- View this message in context: http://www.nabble.com/Self-Organizing-Map-tp22778862p22778862.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] Self-Organizing Map analysis
Dear list, I read the SOM package manual but I don't understand how to perform (for example) 1) the SOM analysis on Iris data 2) with a visualization similar to that of figure 7 in http://www.cis.hut.fi/projects/somtoolbox/package/papers/techrep.pdf Any suggestion? Thanks in advance, Gianandrea -- View this message in context: http://www.nabble.com/Self-Organizing-Map-analysis-tp22306689p22306689.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] dotplot points color
Thank you Deepayan, for this suggestion dotplot(variety ~ yield | site, data = barley, groups = year, pch=21, fill = c(1, 2)) glaporta wrote: Dear list, is it possible to change the background color of dotplot's points? I tried in many ways but unsuccessfully Thanks in advance Gianandrea require(lattice) dotplot(variety ~ yield | site, data = barley, groups = year, pch=21) dotplot(variety ~ yield | site, data = barley, groups = year, pch=21, bg=c(2,3)) ??!!! -- View this message in context: http://www.nabble.com/dotplot-points-color-tp22099530p22117527.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] dotplot points color
Dear list, is it possible to change the background color of dotplot's points? I tried in many ways but unsuccessfully Thanks in advance Gianandrea require(lattice) dotplot(variety ~ yield | site, data = barley, groups = year, pch=21) dotplot(variety ~ yield | site, data = barley, groups = year, pch=21, bg=c(2,3)) ??!!! -- View this message in context: http://www.nabble.com/dotplot-points-color-tp22099530p22099530.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] multisample median test
PS. I tried with: tree-data.frame(n,e,s,w) kruskal.test(tree) but result is not the same of the book... glaporta wrote: Hi, does anyone know a rapid way to perform the multisample median test as the example 10.12 of Biostatistical Analysis of j. Zar (pag. 201) on median elm tree height? The heights were: n-c(7.1,7.2,7.4,7.6,7.6,7.7,7.7,7.9,8.1,8.4,8.5,8.8) e-c(6.9,7,7.1,7.2,7.3,7.3,7.4,7.6,7.8,8.1,8.3,8.5) s-c(7.8,7.9,8.1,8.3,8.3,8.4,8.4,8.4,8.6,8.9,9.2,9.4) w-c(6.4,6.6,6.7,7.1,7.6,7.8,8.2,8.4,8.6,8.7,8.8,8.9) Thanx, Gianandrea -- View this message in context: http://www.nabble.com/multisample-median-test-tp20458703p20458835.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] multisample median test
Hi, does anyone know a rapid way to perform the multisample median test as the example 10.12 of Biostatistical Analysis of j. Zar (pag. 201) on median elm tree height? The heights were: n-c(7.1,7.2,7.4,7.6,7.6,7.7,7.7,7.9,8.1,8.4,8.5,8.8) e-c(6.9,7,7.1,7.2,7.3,7.3,7.4,7.6,7.8,8.1,8.3,8.5) s-c(7.8,7.9,8.1,8.3,8.3,8.4,8.4,8.4,8.6,8.9,9.2,9.4) w-c(6.4,6.6,6.7,7.1,7.6,7.8,8.2,8.4,8.6,8.7,8.8,8.9) Thanx, Gianandrea -- View this message in context: http://www.nabble.com/multisample-median-test-tp20458703p20458703.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] dotplot with a log scale
Dear all, I would like to create a dotplot (lattice) with a log scale as the function http://www.nabble.com/dotchart-with-log-scale--td5411625.html#a5411625 mydotchart of Johannes Huesing. Is it possible? Thanx Gianandrea -- View this message in context: http://www.nabble.com/dotplot-with-a-log-scale-tp20265718p20265718.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] dotplot with a log scale
Perfectly... thanx Deepayan Deepayan Sarkar wrote: On 10/31/08, glaporta [EMAIL PROTECTED] wrote: Dear all, I would like to create a dotplot (lattice) with a log scale as the function http://www.nabble.com/dotchart-with-log-scale--td5411625.html#a5411625 mydotchart of Johannes Huesing. Is it possible? The usual lattice syntax for this is dotplot(..., scales = list(x = list(log = TRUE))) Does this not work? -Deepayan __ R-help@r-project.org mailing list 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. -- View this message in context: http://www.nabble.com/dotplot-with-a-log-scale-tp20265718p20273083.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] Plot means with error bars - A novice needs help
Dear Michael, take a look at plotmeans in gplots library. library(gplots) example(plotmeans) Hope this helps, Gianandrea Michael Just wrote: Hello, I'd appreciate a suggestion on how to construct plots (barplots?) that use means on the Y axis instead of density/count. I'd also like to use groups and plot error or confidence interval bars on these graphs. I know this is a read the manual situation. I'd appreciate help with what to read, or your benevolence with some sample code. I've looked at lattice and gplots2, but given my beginner status my efforts are not propelling me very far. Thank you kindly, Michael Just [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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. -- View this message in context: http://www.nabble.com/Plot-means-with-error-bars---A-novice-needs-help-tp19872142p19873501.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] cca constraining variables table
I performed canonical correspondence analysis (cca) with the example data of vegan, but I'm not able to obtain a table like scores() for the constraining variables. I can see them in the summary() mode, but it would be great to have in a separate table. Any suggestion?, thanx Gianandrea require(vegan) data(varespec) data(varechem) vare.cca-cca(varespec,varechem) scores(vare.cca) summary(vare.cca) -- View this message in context: http://www.nabble.com/cca-constraining-variables-table-tp19688215p19688215.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] plot error
HI there, why these lines of code are correct plot(count~spray, data = InsectSprays) plot(InsectSprays$count) but this return an error: plot(count, data = InsectSprays); data method is not implemented in plot?! Thanx, Gianandrea -- View this message in context: http://www.nabble.com/plot-error-tp19624873p19624873.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] drop unused levels in sqldf
Thanx guys, practical and effective solutions. Gianandrea glaporta wrote: Hi, sqldf is a fantastic package, but when the SELECT procedure runs unused levels remain in the output. I tried with the drop function, but without success. Do you have any suggestions? Thanx, Gianandrea data(iris) require(sqldf) base-sqldf(select * from iris where Species 'setosa') str(base) # Species with 3 levels! -- View this message in context: http://www.nabble.com/drop-unused-levels-in-sqldf-tp19196464p19215127.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] drop unused levels in sqldf
Hi, sqldf is a fantastic package, but when the SELECT procedure runs unused levels remain in the output. I tried with the drop function, but without success. Do you have any suggestions? Thanx, Gianandrea data(iris) require(sqldf) base-sqldf(select * from iris where Species 'setosa') str(base) # Species with 3 levels! -- View this message in context: http://www.nabble.com/drop-unused-levels-in-sqldf-tp19196464p19196464.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] mean-plot (add residuals)
Try with plotmeans in gplots Regards, Gianandrea Jörg Groß wrote: Hi, I want to plot the mean of a variable and add the standard deviation as a line going above and below the mean (like the whiskers in a boxplot) but I don't know how to add these residual-lines. Is there an easy way to do that or do I have to use the line()- function to create them on my own? Thanks for help! __ R-help@r-project.org mailing list 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. -- View this message in context: http://www.nabble.com/mean-plot-%28add-residuals%29-tp18910522p18911651.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] multiple tapply
R: great software and wonderful community! Thanx guys, Gianandrea -- View this message in context: http://www.nabble.com/multiple-tapply-tp18868063p18886279.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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] independent contributes to the discriminant function
I performed Discriminant Function Analysis with lda(MASS), candisc(candisc), discrimin(ade4), NaiveBayes(klaR), but I'm not able to find how to test independent contributes to the discriminant function. In STATISTICA there is the Partial Wilks' Lambda, in SPSS (variable) Wilks' Lambda, but in R there is not trace of something like that or am I wrong? Thanx, Gianandrea -- View this message in context: http://www.nabble.com/independent-contributes-to-the-discriminant-function-tp18889694p18889694.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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.