HI, Dear R community, I have the following codes to calculate the commulative coverage. I want to save the output in a vector, How to do this?
test<-seq(10, 342, by=2) #cover is a vector cover_per<-function (cover) { for (i in min(cover):max(cover)) {print(100*sum(ifelse(cover >= i, 1, 0))/length(cover))} } result<-cover_per(test) > result NULL Can anyone help me this this? -- Sincerely, Changbin -- [[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.