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] >
You should at least initialize indxind to 0 with indxind<-matrix(0,nrow=617, ncol=617) because the default for matrix is to use NA for data. Berend -- View this message in context: http://r.789695.n4.nabble.com/help-please-matrix-operations-inside-3-nested-loops-tp4639592p4639621.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.