Replacing values in an RleList
1
0
Entering edit mode
maltethodberg ▴ 140
@maltethodberg-9690
Last seen 5 days ago
Denmark

Given an RleList (i.e. from either calling coverage() or import.bw()) what is the best way to replace certain values?

I am interested in something this:

x #RleList
x[x < 0] <- 0

I'm doing this many times, and compared to how quick most other operations on RleLists are, this step becomes the bottleneck.

Is there a better way?

rlelist ifelse • 637 views
0
Entering edit mode
theobroma22 ▴ 10
@theobroma22-11920
Last seen 5.0 years ago

Your code doesn't follow the logic for a list object. You need to provide some simulated data!! Lists can take the form of [x][[i]].