Skip to content

Standard sample bracketing#25

Draft
archaeothommy wants to merge 60 commits intomainfrom
FlowerDataProcessing
Draft

Standard sample bracketing#25
archaeothommy wants to merge 60 commits intomainfrom
FlowerDataProcessing

Conversation

@archaeothommy
Copy link
Owner

@Andreaacme2: Is the function ready for merging? If not, what are the to dos?

Andreaacme2 and others added 30 commits October 22, 2025 11:43
Merge branch 'FlowerDataProcessing' of github.com:archaeothommy/ASTR into FlowerDataProcessing

# Conflicts:
#	R/Bracketing.R
@Andreaacme2
Copy link
Collaborator

Hi Thomas,

Let me take a last look at the code and documentation to see all the parameters are described. I will let you know asap.

@archaeothommy archaeothommy self-assigned this Dec 11, 2025
* consistent coding style
* remove unused variables and unecessary declarations
* remove implicit assumption that ID column has fixed name
* increase clarity and consistency of input and documentation.
* add additional input checks
@archaeothommy
Copy link
Owner Author

@Andreaacme2, I revised the function; see the message of e94dbc0 for a summary.

While going through the function, I saw:

  • Nothing is currently done with the input id_std. I assume this is in preparation for when cycle length becomes flexible and left it in.
  • You are labelling the column with the measurement uncertainty as "SE" but the standard deviation is calculated. What is correct here? I would expect, this to be SD throughout.
  • The output currently includes the standards as well. I am not sure if this is intentional or not.

For some reason, the append() functions in the SSB calculation return lists rather than vectors. The reason is most likely that the variables fed into them are of type data.frame/tibble rather than a vector. However, I was not able to figure out why this happens. I created a walkaround by unlist()-ing them before they are combined to the results data frame.

Please clean the folder data-raw and other folders from any leftovers that should not be included in the merge (e.g. the pdfs).

Three questions popped up:

  • While the function performs the SSB calculation, it does not calculate delta values. Should this be done in another function?
  • Why are averages and errors only calculated for the linearly corrected values?
  • What is the benefit of having the linearly calculated values reported when using weighted averages for calculation? The user could run the function just twice to compare the results if he wants to make this comparison, can't he?

Finally, two suggestions for future extension:

  • Turning the multiples of SD into user input. For example, oxygen isotopes are commonly reported in 1SD rather than 2SD. The respective column name in the output should reflect that, which can be easily achieved with e.g. names(results$SD) <- paste0(sd_input, "SD")
  • If the delta values are calculated in this function, it would be great to have it flexible in the notation (i.e., delta = factor 1000, epsilon = factor 10000, etc.). This could be rather neatly done by an input parameter notation = "delta" with a switch() statemet in the function body to pick the correct factor.

@Andreaacme2
Copy link
Collaborator

@archaeothommy Hi!
I started working with the comments related to the standard bracketing function. I have a question about to the third point of your comment. I run a test and the standards are not included on the output. Is it possible that you can send me the test you're using? I will work on the rest on the meantime.

I only left three files in the data-raw folder since I don't know if they are still needed or to who they belong. But I can delete them if you agree.

Thank you!

@archaeothommy
Copy link
Owner Author

Hi @Andreaacme2,
Thanks!

I think that the standards were included is my fault of not properly handling the data input. I do not have the code anymore but I used the ULB dataset and very likely overlooked that the standard was run several times without a sample in between at the beginning. So the code will report the standard because it assumes that every other row of it is a sample, as it actually should! (This might change after we improved the function to the extent that it uses the id_std input parameter.)

Regarding the files in data raw: I would keep the excel file as this was submitted by Alexandra as example for REE normalisation because this is a functionality that is yet to be implemented. The others can be deleted. If you do not want to delete your tidyverse approach of the SSB function, maybe you could move it to a new folder "drafts" or the like in the "dev_guide"? Not sure where to store store such files best...

Andreaacme2 and others added 4 commits January 22, 2026 14:31
-Addition of sd_input variable for displaying 1SD, 2SD, ..., nSD.
-Addition of SBB examples in the data_raw folder
@archaeothommy
Copy link
Owner Author

@Andreaacme2 Thank you so much for implementing the changes. The function looks awesome now! 🤩
I changed the possible values for indicating the notation because the previous ones were so similar that they were prone to typos.

Can I merge the function?

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.

6 participants