User Tools

Site Tools


allelic_size_range

Table of Contents

Allelic size range

barplot

  • file: bar_AllelicSizeRang.r
  • documentation page: 3


code:

read.table("D:/Heidi/Master/R_Daten/AllelicSizeRange/AllelicSizeRange_mic.txt",
            skip=4, row.names=1, fill=TRUE )-> Data
  Data

nrow(Data) -> a
ncol(Data) -> b

Data2 <- as.matrix.data.frame(Data)

Data3 <- Data2[1:(a-2),1:(b-3)]
  Data3
 
barplot(Data3, beside=TRUE, legend.text=TRUE, main="Allelic size range
         at different loci", xlab="Populations", ylab="Allelic size",
         ylim=c(0,(max(Data3)+(max(Data3)/4))))

lines

  • file: lines_AllelicSizeRang.r
  • document page: 10


code:

read.table("D:/Master/R_Daten/AllelicSizeRange/AllelicSizeRange_mic.txt", skip=4 ,row.names=1, fill=TRUE )-> Data

a <- nrow(Data)
b <- ncol(Data)

Data <- as.matrix.data.frame(Data)

Data <- Data[1:(a-2),1:(b-3)]
nRow <- nrow(Data)
nCol <- ncol(Data)

x <- 1
               
plot(Data[x,], type="l", xlab="Population", ylab="Allelic size", main="Allelic size range at different loci",
     ylim=c(0,(max(Data)+(max(Data)/4))), xaxt="n", col=1, lwd=1.5 )
    
    x <- x + 1
    while(x <= nRow){
        lines(Data[x,], col=x, lwd=1.5)
        x <- x + 1
    }
    axis(1, 1:nCol)
    legend("topright", legend=c(1:(x-1)), lty=1, bty="n", col=c(1:x), lwd=1.5, title="Locus")
allelic_size_range.txt · Last modified: 2008/09/23 14:54 by heidi