[R] trimming plotting area in a boxplot
Hello all, I am trying to trim the plotting area in a boxplot, such that the space between the plot margins (left and right) are of identical size as between the boxes. In the example below I want to get rid of the space outside of the abline(). I appreciate any suggestions. Factor = LETTERS[1:5] A = c(1:5); B = c(2:6); C = c(1:5); D = c(3:7); E = c(1:5); F = c(4:8) df = data.frame(A,B,C,D,E,F) boxplot(df) abline(v=c(0.5,6.5)) Cheers, Patrick __ R-help@stat.math.ethz.ch 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] comparing mantel tests for three different species
Hi, I have calculated mantel statistics for three plant species to check for isolation by distance (thus, comparing genetic distance to geographic distance). Now, I would like to test whether the species have significantly different isolation by distance behaviour. Is there a R-function that allows me to do this? Cheers and thank for any comments Patrick -- Patrick Kuss PhD-student Institute of Botany University of Basel Schönbeinstr. 6 CH-4056 Basel +41 61 267 2976 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] assigning 'heat.colors' according to ages in 'symbols()'
Hi, I have spatial data for plants that I would like to plot according to its radius using sysmbols(). Also I would like to color the circles according to an individual's age using heat.colors(17) [ages within the whole data set range from 0:16]. I have not found an easy way to assign ages (=a) a specific heat.color. Any suggestions? Thanks, Patrick x - c(1,3,4,6,7,3,2,8,3,6,5,5) y - c(0,5,4,2,7,6,4,5,3,7,9,2) r - c(0.1,0.4,0.3,0.2,0.5,0.3,0.2,0.4,0.3,0.2,0.1,0.2) a - c(0,4,2,3,5,6,8,2,9,10,11,6) symbols(x,y,circles=r,bg=heat.colors(17),xlim=c(0,10),ylim=c(0,10),inches=F) -- Patrick Kuss PhD-student Institute of Botany University of Basel Schönbeinstr. 6 CH-4056 Basel +41 61 267 2976 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] lattice histogram finetuning
Dear list, I have some difficulties fine-tuning a lattice conditional histogram plot and found little help in the documentation. My dataset consists of plant flowering ages from 3 different altitudes and 3 successional sites at each altitudinal level. My questions are: How do I avoid that lattice automatically sorts the different $condlevels alphabetically? I need: hist$condlevels$succession - list(early,mid,late) # not early,late,mid hist$condlevels$site - list(FU,SP,JU) Additionally, how do I add a vertical line indicating the mean flowering age at each panel? And how do I assure breaks to happen for each year? hist$panel.args.common$breaks Happy for any suggestions Patrick # Flowering age at different altitudes and successional site FU.e - round(rnorm(20,mean=9,sd=1),dig=0) FU.m - round(rnorm(20,mean=12,sd=1),dig=0) FU.l - round(rnorm(20,mean=15,sd=1),dig=0) SP.e - round(rnorm(20,mean=8,sd=1),dig=0) SP.m - round(rnorm(20,mean=11,sd=1),dig=0) SP.l - round(rnorm(20,mean=14,sd=1),dig=0) JU.e - round(rnorm(20,mean=7,sd=1),dig=0) JU.m - round(rnorm(20,mean=10,sd=1),dig=0) JU.l - round(rnorm(20,mean=13,sd=1),dig=0) age - c(FU.e,FU.m,FU.l,SP.e,SP.m,SP.l,JU.e,JU.m,JU.l) site - rep(c(FU,SP,JU),each=60) succession - rep(c(early,mid,late),each=20,times=3) CT.flow - data.frame(site,succession,age) library(lattice) trellis.device(color=F) hist - histogram(~age|succession*site,data=CT.flow) hist -- Patrick Kuss PhD-student Institute of Botany University of Basel Schönbeinstr. 6 CH-4056 Basel +41 61 267 2976 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] dendrogram branches with different lty
Dear r-list, I am trying to visually seperate the two main clusters of a dendrogram. The idea is to use: 'edgePar=list(lty=3)' for 'dend1[[1]]' and 'edgePar=list(lty=1)' for 'dend1[[2]]' I have not found a way to solve this. Any suggestions? Patrick hc - hclust(dist(USArrests), ave) (dend1 - as.dendrogram(hc)) par(mfrow=c(2,2)) plot(dend1) plot(dend1[[1]],edgePar=list(lty=3)) plot(dend1[[2]],edgePar=list(lty=1)) -- Patrick Kuss PhD-student Institute of Botany University of Basel Schönbeinstr. 6 CH-4056 Basel +41 61 267 2976 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] retrieving p-values in lm
Dear list, I want to retrieve the p-value of a two-polynomial regression. For a one-polynomial lm I can easily do this with: summary(lm(b~a, data=c)[[4]][[8]]. But how do I find the final p-value in the two-polynomial regression? Under $coefficients I don't find it Any suggestions? Patrick alt -(2260,2183,2189,1930,2435, 2000,2100,2050,2020,2470, 1700,2310,2090,1560,2060, 1790,1940,2100,2250,2010) H - c(0.2034,0.1845,0.2053,0.1788,0.2196, 0.2037,0.1655,0.2176,0.1844,0.2033, 0.1393,0.2019,0.1975,0.1490,0.1917, 0.2180,0.2064,0.1943,0.2139,0.1320) X - data.frame(alt,H) lm.res - summary(lm(H~alt,data=X)) lm.res p1 - lm.res[[4]][[8]] p1 lm.res.2 - summary(lm(H~alt+I(alt^2),data=X)) lm.res.2 str(lm.res.2) # where is p p2 - lm.res.2[[???]][[]] -- Patrick Kuss PhD-student Institute of Botany University of Basel Schönbeinstr. 6 CH-4056 Basel +41 61 267 2976 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] running AMOVA from spreadsheet genotype data
Hi, I plan to run amova in R from randomly generated subsets of my original dataset. The structure of my data looks as below: region - rep(c(east,west),each=8) pop - c(rep(1:4,each=4)) ind - c(rep(1:4,4)) l.1 - c(1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0) l.2 - sample(c(0,1),16,replace=T) l.3 - sample(c(0,1),16,replace=T) l.4 - sample(c(0,1),16,replace=T) l.5 - sample(c(0,1),16,replace=T) l.6 - sample(c(0,1),16,replace=T) data - data.frame(region,pop,ind,l.1,l.2,l.3,l.4,l.5,l.6) data Is there an easy way to generate amova style $samples, $distances, $structures data.frames from my data subset? Cheers Patrick -- Patrick Kuss PhD-student Institute of Botany University of Basel Schönbeinstr. 6 CH-4056 Basel +41 61 267 2976 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] running AMOVA from spreadsheet genotype data
- Weitergeleitete Nachricht von Patrick Kuss [EMAIL PROTECTED] - Datum: Tue, 25 Oct 2005 17:28:33 +0200 Von: Patrick Kuss [EMAIL PROTECTED] Antwort an: Patrick Kuss [EMAIL PROTECTED] Betreff: running AMOVA from spreadsheet genotype data An: [EMAIL PROTECTED] Hi, I plan to run AMOVA in R from randomly generated subsets of my original dataset. The structure of my data looks as below: region - rep(c(east,west),each=8) pop - c(rep(1:4,each=4)) ind - c(rep(1:4,4)) l.1 - c(1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0) l.2 - sample(c(0,1),16,replace=T) l.3 - sample(c(0,1),16,replace=T) l.4 - sample(c(0,1),16,replace=T) l.5 - sample(c(0,1),16,replace=T) l.6 - sample(c(0,1),16,replace=T) data - data.frame(region,pop,ind,l.1,l.2,l.3,l.4,l.5,l.6) data Is there an easy way to generate amova style $samples, $distances, $structures data.frames from my data subset? Cheers Patrick -- Patrick Kuss PhD-student Institute of Botany University of Basel Schönbeinstr. 6 CH-4056 Basel +41 61 267 2976 - Ende der weitergeleiteten Nachricht - -- Patrick Kuss PhD-student Institute of Botany University of Basel Schönbeinstr. 6 CH-4056 Basel +41 61 267 2976 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html