Re: [R] help, please! matrix operations inside 3 nested loops

2012-08-09 Thread Petr PIKAL
Hi > all problems solved. thank you for your help! > for the sake of completeness, here my solution: > #1) read in data: > daten<-read.table('K:/Analysen/STRUCTURE/test.txt', header=TRUE, sep="\t") > daten<-as.data.frame(daten) not needed, daten is already data frame

Re: [R] help, please! matrix operations inside 3 nested loops

2012-08-09 Thread Petr PIKAL
Hi > thank you for your help. > > my input data looks like this (tab separated): > > Ind.nr. Pop.nr. scm266 rms1280 scm247 rms1107 > 1 101 305 318 222 135 > 1 101 305 318 231 135 > 2 101 305 313 999 96 > 2 101 305 321 999 130 > 3 101 305 32

Re: [R] help, please! matrix operations inside 3 nested loops

2012-08-09 Thread Fridolin
all problems solved. thank you for your help! for the sake of completeness, here my solution: #1) read in data: daten<-read.table('K:/Analysen/STRUCTURE/test.txt', header=TRUE, sep="\t") daten<-as.data.frame(daten) #2) create empty matrix: indxind<-matrix(0,nrow=617, ncol=617) #indxind[1:20,1:19]

Re: [R] help, please! matrix operations inside 3 nested loops

2012-08-09 Thread Fridolin
SORRY it should be: Fridolin wrote > > for (s in 3:6) { #walks though the matrix colum by colum, starting at > colum 3 > for (z1 in 1:5) { #for each current colum, take one row (z1)... > for (z2 in 1:5) { #...and compare it to another row (z2) of the > current colum > error is go

Re: [R] help, please! matrix operations inside 3 nested loops

2012-08-09 Thread Fridolin
thank you for your help. my input data looks like this (tab separated): Ind.nr. Pop.nr. scm266 rms1280 scm247 rms1107 1 101 305 318 222 135 1 101 305 318 231 135 2 101 305 313 999 96 2 101 305 321 999 130 3

Re: [R] help, please! matrix operations inside 3 nested loops

2012-08-08 Thread Berend Hasselman
Fridolin wrote > > hello, this is my script: > > #1) read in data: > daten<-read.table('K:/Analysen/STRUCTURE/input_STRUCTURE_tab_excl_5_282_559.txt', > header=TRUE, sep="\t") > daten<-as.matrix(daten) > > #2) create empty matrix: > indxind<-matrix(nrow=617, ncol=617) > indxind[1:20,1:19] >

Re: [R] help, please! matrix operations inside 3 nested loops

2012-08-08 Thread R. Michael Weylandt
On Wed, Aug 8, 2012 at 9:06 AM, Fridolin wrote: > hello, this is my script: > > #1) read in data: > daten<-read.table('K:/Analysen/STRUCTURE/input_STRUCTURE_tab_excl_5_282_559.txt', > header=TRUE, sep="\t") > daten<-as.matrix(daten) > > #2) create empty matrix: > indxind<-matrix(nrow=617, ncol=617

[R] help, please! matrix operations inside 3 nested loops

2012-08-08 Thread Fridolin
hello, this is my script: #1) read in data: daten<-read.table('K:/Analysen/STRUCTURE/input_STRUCTURE_tab_excl_5_282_559.txt', header=TRUE, sep="\t") daten<-as.matrix(daten) #2) create empty matrix: indxind<-matrix(nrow=617, ncol=617) indxind[1:20,1:19] #3) compare cells to each other, score: fo