Hi all, I want to create a new matrix based on a previous matrix.
You see, If my "data" matrix accomplises this: if(rowSums(data[i,])>16|rowSums(data[i,])<28) data[i,]= data[i,] # if sum of rows is more than 16 and less 28 I conservate the row #but How I say if else "remove" the line (I tried this) but doesn´t works...I´m really a asn else if(data[i,]=data[-i,]) } You see imagine my data matrix is 10x4 and only 3 rows passes the condition...the resulting matrix will be 3x4 I tried also to save the new matrix as csv like this write.csv(data, file = "input1.csv") How should I proceed to save as a txt? Many thanks I really like this problems but I feel my mind is restricted to more easy things¡¡¡jajaj [[alternative HTML version deleted]]
______________________________________________ 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.