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

add linearity tests for calibration data #3

Merged
merged 12 commits into from
Jan 22, 2025
Merged

Conversation

TellAnAx
Copy link
Contributor

Guten Tag Herr Ranke,
wie besprochen einmal ein PR, zunächst einmal für einen Linearitätstest. Ich dachte wir können erstmal klein anfangen, um das Ganze überschaubar zu halten.
Ich bin gespannt auf das Feedback!
Mit besten Grüssen,
A. Tellbüscher

@jranke
Copy link
Owner

jranke commented Nov 17, 2024

I have only briefly looked at the code and have taken the liberty of modify the PR by using the match.arg() function to check the method argument because I think it will be easier for others to understand what the code does.

As far as the tests are concerned, I am surprised that the point to point slope for the data set used in the example shows so many points outside the tolerance range. From my point of view, this does not mean that the method is not linear, it simply has a high scatter. What do you think?

@TellAnAx
Copy link
Contributor Author

Great, I was not aware of the match.arg() function. This is a much more elegant way and thus much appreciated!

Regarding the test results: Yes, you are right that the din32645 data is not particularly well-suited to showcase the use of the linearity() function. This could be better done by using one of the example datasets provided in the Excel sheet for linearity testing written by the Water Chemistry Society (here). The tolerance range of 10% also depends on the analytical method chosen. Unfortunately, I do not have access to a copy of DIN 32 645. Do you know the method that was used to acquire the data? Regarding the function itself: Would a more detailed explanation do the job in this case? What do you think?

@jranke
Copy link
Owner

jranke commented Nov 20, 2024

Adding a comment to the example code would be an option. Another possibility would be to write a small vignette on linearity tests. Including another dataset also could be useful. However, as I said, I cannot invest a lot of time in this package, there would be so many things that could be done to improve it, but I am not doing analytics any more.

@TellAnAx
Copy link
Contributor Author

Alright! My time is also limited, but, as mentioned, I am willing to contribute more to this package. I don't know whether the analytic community waited for this, but at least I was looking for a good toolbox to analyse my data for way too long now, so better doing the job myself instead of waiting forever! :) I will add some additional example data then. I just need to figure out how to add an additional commit to this pull request! :)

@jranke
Copy link
Owner

jranke commented Nov 25, 2024 via email

@jranke
Copy link
Owner

jranke commented Jan 22, 2025

Thanks for your work on this! On checking the package, I got

* checking for missing documentation entries ... WARNING
Undocumented code objects:
  ‘test’
Undocumented data sets:
  ‘test’

and later in the example code

* checking files in ‘vignettes’ ... OK
* checking examples ... ERROR
Running examples in ‘chemCal-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: linearity
> ### Title: Assess the linearity of a calibration curve
> ### Aliases: linearity
> 
> ### ** Examples
> 
> # Continuous Flow Analysis (CFA) data
> data(din38402b1)
> 
> # Point-to-point slope plot
> linearity(din38402b1$conc, din38402b1$ext, method = "slope")
Error: object 'din38402b1' not found
Execution halted

The reason is that the datasets in the data/*.rda files were all named test, i.e. after loading them with e.g. load("data/din38402b1.rda), there was a dataset named test, not a dataset named din38402b1. So I manually loaded the datasets, renamed them and saved them in the same location. After that, the checks are fine.

- Depend on R >= 3.5.0, because the format used for the data is not
  known to earlier R versions
- Rename the datasets from `test` to their proper name
@jranke jranke merged commit 7790a01 into jranke:main Jan 22, 2025
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.

2 participants