[R] summing up a column.

oslo hokut1 at yahoo.com
Fri Jun 10 22:34:03 CEST 2016


Dear All;
I had difficulty to post a mail along with appropriate of data structure. I do sincerely apologize for multiple posting


I would like to sum up the B$a column and cut off at 0.7 for the each row of intervals giving in file=A.For example the interval  at the first row in A$posA and A$posB is 1 and 9. So, I need adding up the B$a and cut off B$a>.7 from the 1 to 9 in B$pos. And then I need to the same using the intervals in the second, third..... rows in A. Obviously my loop is wrong and  does not work properly. Please help for my this first experience.  Regards
Here are my codes
#sorting B$possort=B[order(B$pos),]
#Running loop
for(i in 1:nrow(A)) {if(sum(B[a$B, i:A[1:2])>0.7) {print(A[1:i,]) } }
Reply, R
-------------- next part --------------
A non-text attachment was scrubbed...
Name: blob.jpg
Type: image/png
Size: 7564 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20160610/0e63a506/attachment.png>


More information about the R-help mailing list