Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable g.calibrate to handle temperature data from ad-hoc csv file #992

Closed

Conversation

vincentvanhees
Copy link
Member

@vincentvanhees vincentvanhees commented Dec 12, 2023

Fixes #991

Checklist before merging:

  • 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).
  • Updated or expanded the documentation.
  • 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.

@vincentvanhees
Copy link
Member Author

Hi @l-k- I am just tagging you to give you a heads up that I have prepared this small PR. It is a fairly straightforward minor fix I think and will merge this tomorrow.

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (ededec3) 78.41% compared to head (8ee7673) 78.43%.

Files Patch % Lines
R/g.calibrate.R 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #992      +/-   ##
==========================================
+ Coverage   78.41%   78.43%   +0.01%     
==========================================
  Files          99       99              
  Lines       13371    13368       -3     
==========================================
  Hits        10485    10485              
+ Misses       2886     2883       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

columns_to_use = 1:3
}
data = P$data[, columns_to_use]
data = P$data[, c(params_rawdata[["rmc.col.acc"]], params_rawdata[["rmc.col.temp"]])]
Copy link
Collaborator

@l-k- l-k- Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might actually be incorrect?

We get P$data from read.myacc.csv, and there it gets populated with columns c("timestamp","accx","accy","accz","temperature"), in that exact order. You can see it here:
https://github.com/wadpac/GGIR/blob/master/R/read.myacc.csv.R#L172-L179

So it doesn't matter where the acceleration and temperature columns were located in the original csv file. P$data$temperature is always 4th or 5th column (depending on whether there is a timestamp column), no matter what params_rawdata[["rmc.col.temp"]] value was. And acceleration columns are always either 1:3 or 2:4, no matter what params_rawdata[["rmc.col.acc"]] values were.

It was just a coincidence that our test file had rmc.col.acc = 2:4, rmc.col.temp = 5, like what read.myacc.csv produces.

I'll send an alternative PR in a bit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting that Lena, I will now close this PR.

@vincentvanhees vincentvanhees deleted the issue991_tempcolumn_adhoccsv_calibration branch December 13, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adhoc csv data processing cannot handle temperature column
2 participants