Thanks, Erich!
On Mon, Nov 1, 2010 at 4:55 AM, Erich Neuwirth
wrote:
> My guess is that what you want probably is best done by using ecdf.
> You might want to look it up in the docs.
>
> 1-ecdf(test)(x)
> Will give you the percentage of values in test larger than x.
>
>
> On 11/1/2010 2:24 AM,
My guess is that what you want probably is best done by using ecdf.
You might want to look it up in the docs.
1-ecdf(test)(x)
Will give you the percentage of values in test larger than x.
On 11/1/2010 2:24 AM, Changbin Du wrote:
> Thanks Joshua! Yes, i is not going up sequentially by 1, as i he
Thanks Joshua! Yes, i is not going up sequentially by 1, as i here is the
raw number of reads for each DNA base. Thanks so much for the great help!
On Sun, Oct 31, 2010 at 6:03 PM, Joshua Wiley wrote:
> On Sun, Oct 31, 2010 at 5:44 PM, Joshua Wiley
> wrote:
>
> > #cover is a vector
> > cover_
HI, David, Juan, and Joshua,
Thanks so much for your help! The following codes works. Appreciated!
test<-seq(10, 342, by=2)
#data is a vector
cover_per<-function (data) {
output<-vector("numeric",length(min(data):max(data)))
for (i in min(data):max(data)) {
output[i]<-(100*sum(i
On Sun, Oct 31, 2010 at 5:44 PM, Joshua Wiley wrote:
> #cover is a vector
> cover_per <- function(cover) {
> ## create a vector to store the results of your for loop
> output <- vector("numeric", length(min(cover):max(cover)))
> for (i in min(cover):max(cover)) {
> ## rather than print()ing
On Oct 31, 2010, at 8:35 PM, Changbin Du wrote:
HI, Dear R community,
I have the following codes to calculate the commulative coverage.
Not sure exactly what you mean by this. My guess is implemented below.
I want to
save the output in a vector, How to do this?
test<-seq(10, 342, by=2)
#
Hi Changbin,
The yek is that you need to save the results of your for loop rather
than just printing it. It also may be possible to vectorize your for
loop which might simplify things and speed them up, but I did not look
at that. Here is one way to save the results, see inline comments for
more
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))/lengt
8 matches
Mail list logo