Later in g.convert.part2.long(), we were attempting to validate these features and this caused the method to crash.
To fix this, I changed the code in g.convert.part2.long() to not evaluate columns that aren't there.
I also cleaned up part of the condition. It looked to me that we want FUN = function(x) all(x=="")), not FUN = function(x) any(x=="")). And also checking for df[,ncol(df)-1] == "" & df[,ncol(df)] == "" doesn't seem necessary because we've already just checked columns up to ncol(df).
I would appreciate it if someone could check if this makes sense.
Checklist before merging:
[X] Existing tests still work (check by running the test suite, e.g. from RStudio).
[ ] Added tests (if you added functionality) or fixed existing test (if you fixed a bug).
[X] Clean code has been attempted, e.g. intuitive object names and no code redundancy.
[ ] Documentation updated:
[ ] Function documentation
[ ] Chapter vignettes for GitHub IO
[ ] Vignettes for CRAN
[X] Corresponding issue tagged in PR message. If no issue exist, please create an issue and tag it.
[X] Updated release notes in inst/NEWS.Rd with a user-readable summary. Please, include references to relevant issues or PR discussions.
[ ] Added your name to the contributors lists in the DESCRIPTION file, if you think you made a significant contribution.
[ ] GGIR parameters were added/removed. If yes, please also complete checklist below.
If NEW GGIR parameter(s) were added then these NEW parameter(s) are :
[ ] documented in man/GGIR.Rd
[ ] included with a default in R/load_params.R
[ ] included with value class check in R/check_params.R
[ ] included in table of vignettes/GGIRParameters.Rmd with references to the GGIR parts the parameter is used in.
[ ] mentioned in NEWS.Rd as NEW parameter
If GGIR parameter(s) were deprecated these parameter(s) are:
[ ] documented as deprecated in man/GGIR.Rd
[ ] removed from R/load_params.R
[ ] removed from R/check_params.R
[ ] removed from table in vignettes/GGIRParameters.Rmd
[ ] mentioned as deprecated parameter in NEWS.Rd
[ ] added to the list in R/extract_params.R with deprecated parameters such that these do not produce warnings when found in old config.csv files.
Fixes #1010
When data has no days with enough valid hours, g.analyse.perday() doesn't add per-day-segment features to daysummary
Later in g.convert.part2.long(), we were attempting to validate these features and this caused the method to crash.
To fix this, I changed the code in g.convert.part2.long() to not evaluate columns that aren't there.
I also cleaned up part of the condition. It looked to me that we want
FUN = function(x) all(x==""))
, notFUN = function(x) any(x==""))
. And also checking fordf[,ncol(df)-1] == "" & df[,ncol(df)] == ""
doesn't seem necessary because we've already just checked columns up toncol(df)
.I would appreciate it if someone could check if this makes sense.
Checklist before merging:
inst/NEWS.Rd
with a user-readable summary. Please, include references to relevant issues or PR discussions.DESCRIPTION
file, if you think you made a significant contribution.If NEW GGIR parameter(s) were added then these NEW parameter(s) are :
man/GGIR.Rd
R/load_params.R
R/check_params.R
vignettes/GGIRParameters.Rmd
with references to the GGIR parts the parameter is used in.If GGIR parameter(s) were deprecated these parameter(s) are:
man/GGIR.Rd
R/load_params.R
R/check_params.R
vignettes/GGIRParameters.Rmd
R/extract_params.R
with deprecated parameters such that these do not produce warnings when found in old config.csv files.