0

I have a dataset that looks like that shown below and I am trying to calculate the baseline using the rollingball function as part of the baseline package.

My code is like that shown herre however, I am getting the error "incorrect number of dimensions". Can anyone help?

bc.rollingBall <- baseline(CO2_Data$co2_mixing_ratio[1,, drop=FALSE], wm=30, ws=30,
method='rollingBall')

enter image description here

r2evans
  • 141,215
  • 6
  • 77
  • 149
James
  • 137
  • 7
  • Please do not post an image of code/data/errors: it breaks screen-readers and it cannot be copied or searched (ref: https://meta.stackoverflow.com/a/285557 and https://xkcd.com/2116/). Please just include the code, console output, or data (e.g., `data.frame(...)` or the output from `dput(head(x))`) directly. – r2evans Oct 12 '21 at 21:59
  • It's likely `CO2_Data$co2_mixing_ratio[1,, drop=FALSE]` (which if you call on the console without `baseline(...)`, it'll likely err as well. My guess is that `CO2_Data` is a frame, but `CO2_Data$co2_mixing_ratio` is a vector, so it does not support multiple-dimension indexing with `[1,,drop=FALSE]`. It's a little confusing that it appears you want to run `baseline` on a *single value* (or perhaps a *single row*). What are you trying to do when you index down with `[1`? – r2evans Oct 12 '21 at 22:01

0 Answers0