User Tools

Site Tools


population_assignment_test

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
population_assignment_test [2008/01/21 09:32] – removed heidipopulation_assignment_test [2008/07/22 13:31] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Population assignment test ======
 +  * file: points_assignmentTest.r
 +  * document page: 24
  
 +\\
 +**code:**
 +<code>
 +#----read data--------------------------------------------------------------
 +sample1 <- read.table("D:/Heidi/Master/R_Daten/assignmentTest/sample1.txt", 
 + skip=3 ) 
 +sample2 <- read.table("D:/Heidi/Master/R_Daten/assignmentTest/sample2.txt", 
 + skip=3 )
 +  
 +sample1 <- as.matrix(sample1[2:3])
 +sample2 <- as.matrix(sample2[2:3])
 +
 +min_x <- min(sample1[,1], sample2[,1])
 +min_y <- min(sample1[,2], sample2[,2])
 +
 +#----draw plot--------------------------------------------------------------
 +op <- par(mar=c(2,2,6,5))
 +  plot(sample1, col="blue", pch=21, xlim=c(min_x, 0), ylim=c(min_y, 0), 
 + xlab="", ylab="", axes=FALSE)
 +    points(sample2, col="red", pch=22)
 +    lines(c(min_x, 0), c(min_y ,0))
 +  
 +    legend("topleft", c("Population 1", "Population 2"), bty="n",
 +            col=c("blue", "red"), pch=c(21,22))
 +    axis(side=3, cex.axis=0.8)
 +    axis(side=4, cex.axis=0.8)
 +    mtext("Population assignment test", side=3, line=3.5, font=2, cex=1.5)
 +    mtext("Log(L(Population 1))", side=3 , line=2, font=2)
 +    mtext("Log(L(Population 2))", side=4 , line=2, font=2)
 +    box()
 +
 +#---- At end of plotting, reset to previous par settings:----
 +par(op)
 +</code>
population_assignment_test.1200904330.txt.gz · Last modified: 2008/07/22 13:30 (external edit)