Regression(): bug in na.action and other suggestions
Hi @cdelgado
Thanks for your exhaustive test on Regression()! I listed part of your feedback here for the ease of discussion.
- The option "na.fail" for the "na.action" argument. When I tried it with a time series with NAs, it doesn't return an error (which is expected).
Thanks for finding this! I will check it. The other thing we should consider is that change the default to na.fail. It is the default of lm(), and in this way, it can be in line with MeanDims(), which was discussed in the last R user meeting. People can be aware of NA while using the functions.
- I would do a small change in the argument "time_dim": in s2verification, this argument has to be a number (the index of the dimension), while in s2dv it has to be a string (the name of the dimension). It would be nice to have both options, since sometimes you may want to do the regression of to an array with only 1 dimension, so it wouldn't be needed to name this only one dimension.
We want to force the users to use names to specify the dimension because it can avoid undetected mistakes (e.g., use the previous script and do the regression over the undesired dimension.) But if the data is only one dimension (i.e., a vector), I think it will be good to make the function work.
I would rename "time_dim": you may want to calculate the regression of another dimension (not always with the time).
We can consider renaming it to 'reg_dim'.
Please let me know your thoughts, @nperez . Thanks!
Cheers,
An-Chi