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 the replace_metadata<-() method for the Risoe.BINfileData class #514

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

mcol
Copy link
Contributor

@mcol mcol commented Dec 5, 2024

This is the first part of #480, implementing my suggestion at #480 (comment).

Copy link
Member

@RLumSK RLumSK left a comment

Choose a reason for hiding this comment

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

Great. I had to look two times into the sel with the tryCatch() but this is a very elegant solution.

@RLumSK RLumSK merged commit fbd4a14 into master Dec 6, 2024
9 checks passed
@mcol mcol deleted the issue_480_p1 branch December 6, 2024 09:59
@mcol
Copy link
Contributor Author

mcol commented Dec 6, 2024

That part of the code comes almost directly from get_RLum() for RLum.Analysis objects, so it's not that original: 😄

sel <- tryCatch(eval(
expr = substitute(subset),
envir = envir,
enclos = env
),
error = function(e) {
.throw_error("Invalid subset expression, valid terms are: ",
.collapse(names(envir)))
})
if (!is.logical(sel)) {
.throw_error("'subset' must contain a logical expression")
}
if (all(is.na(sel)))
sel <- FALSE

@RLumSK
Copy link
Member

RLumSK commented Dec 6, 2024

Hm, OK, obviously I could not recall this anymore, although I just had touched this function recently.

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