Question: Replacing values in an RleList
0
2.8 years ago by
maltethodberg140
Sweden
maltethodberg140 wrote:

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?

ifelse rlelist • 441 views
modified 2.8 years ago by theobroma2210 • written 2.8 years ago by maltethodberg140
Answer: Replacing values in an RleList
0
2.8 years ago by
theobroma2210
theobroma2210 wrote:

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]].