Open epurdom opened 4 years ago
@NelleV I'm okay with fixing this in the package, but can you weigh in on why you used make.names
to begin with here and whether/why we need to keep that?
Hi Elizabeth, I don't remember why I did this. I'm not sure we need to keep this: I think I just reused some code from an example somewhere, and never gave more thought to this line of code.
I'm wondering if these names become the header of a data frame output at somepoint, even just as intermediate step? I think removing make.names
will actually need to be delicately tested, but I'll look into it.
I just ran into this issue with Timepoints which have a starting point of -1. Switching them to 0 fixed the issue, but either a specific note in the docs/vignette (which I very well may have missed) or some way of specifically alerting the user would be nice.
background :
In this experiment, timePoint 0 was unmeasured. It was the point at which a sugar source was flowed into a medium. timePoint -1 was a measurement from before timePoint 0, which I realize is not really a timePoint at all. I think the best solution to this particular issue is just a note in the docs, or some error handling in the code, to tell the user "timepoints need to be 0 or greater decimals, silly".
If the Group variable takes on values that have a character value that is not allowed by
make.names
(i.e. the function that checks for valid column header names for a data.frame), then theWeeklyGroup
variable that is internally created won't match the Group variable names, because the definition ofWeeklyGroup
appliesmake.names
to the group variable before combining with timepoints variable (line 187 in AllClasses.R)I'm not really sure why we do this, but this creates a problem is
Group
is created by pasting together factors, e.g.At a minimum, we should apply
make.names
to the Group variable rather than only when we define WeeklyGroup. But if we don't needmake.names
then it would be better to get rid of it so that we aren't changing the data of the user.