“cf” is a type, a variable name and a member
Closed this issue · 3 comments
We have four places in the code where we use cf
:
- In the
cf
class and its constructorcf()
. - As the data member
x$cf
of thecf
class which contains the original measurements. - As function parameter where a correlation function is expected.
- As a data frame in
matrixfit
, albeit namedCF
there.
This has been very confusing for people new to the code.
I believe that Item 3 can be fixed with reasonable effort by doing a search-replace of \bcf\b
(or \<cf\>
in Vim) with say corr
. Item 2 will be harder as a lot of user code depends on the name of this data member.
And then there is also CF
in matrixfit
which is a data frame with the correlation function (mean value).
Let's rename everything that is not the container. I.e. cf$cf
should be cf$data
. CF
should be val
or value
. Err
should be dval
, dvalue
or err
if preferred. Personally I like the option of having a possible hierarchy val -> dval -> ddval
.
Is there any way that we can make sure that it works after the refactoring? Replacing (regex) \$cf\b
with $data
sounds straightforward, but I fear that something breaks. Ideally we would have unit tests with full coverage (measured with say covr). From the package README I have the impression that the examples are not part of the covering.
Also users might use cf$cf
directly in their functions. Can we accept this API break?
The d
-prefix is fine with me.