Description Usage Arguments Value Author(s) Examples
View source: R/inter.intra.plot.R
Plot histogram for inter and intra-specific distances together
1 2 3 4 |
dismat |
a symmetric matrix containing the pairwise genetic distances between individual sequences. |
xlim |
a vector containing the minimum and maximum value in the x-axis |
ylim |
a vector containing the minimum and maximum value in the y-axis |
intra.col |
the colour for the intraspecific distance distribution |
intra.density |
a numeric, the density of shading lines for the intraspecific distance distribution |
intra.n |
a numeric, the number of categories to represent in the intraspecific distance distribution |
plot |
a string, "freq" to represent frequency values in the y-axis and "N" for number of occurrences |
inter.col |
the colour for the interspecific distance distribution |
inter.density |
a numeric, the density of shading lines for the interspecific distance distribution |
inter.n |
a numeric, the number of categories to represent in the interspecific distance distribution |
legend |
a logic, "TRUE" to show plot legend |
main |
a string containing the title of the plot |
xlab |
a string with the label of the x-axis |
ylab |
a string with the label of the x-axis |
A list with two elements:
Intraspecific |
a vector containing all the intraspecific distances. |
Interspecific |
a vector containing all the interspecific distances. |
A.J. Muñoz-Pajares
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # # Generating a distance matrix:
#
# my.mat<-matrix(nrow=100,ncol=100,
# dimnames=list(paste("sp",rep(1:2,50),
# sep=""),paste("sp",rep(1:2,50),sep="")))
# L<-my.mat[seq(1,nrow(my.mat),2),seq(1,ncol(my.mat),2)]
# my.mat[seq(1,nrow(my.mat),2),seq(1,ncol(my.mat),2)]<-rnorm(0.15,n=L,sd=0.01)
# my.mat[seq(2,nrow(my.mat),2),seq(2,ncol(my.mat),2)]<-rnorm(0.15,n=L,sd=0.01)
# my.mat[seq(1,nrow(my.mat),2),seq(2,ncol(my.mat),2)]<-rnorm(0.3,n=L,sd=0.04)
# my.mat[seq(2,nrow(my.mat),2),seq(1,ncol(my.mat),2)]<-rnorm(0.3,n=L,sd=0.04)
# #Converting to symmetric
# my.mat<-as.matrix(as.dist(my.mat))
# inter.intra.plot(dismat=my.mat)
# inter.intra.plot(dismat=my.mat,intra.n=10)
# inter.intra.plot(dismat=my.mat,plot="Freq",intra.n=10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.