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

crashes in plot_NRt() #177

Closed
mcol opened this issue Aug 28, 2024 · 4 comments
Closed

crashes in plot_NRt() #177

mcol opened this issue Aug 28, 2024 · 4 comments

Comments

@mcol
Copy link
Contributor

mcol commented Aug 28, 2024

The following examples crash due to insufficient input validation:

plot_NRt("error")
# Error in plot_NRt("error") : object 'curves' not found
data("ExampleData.RLum.Analysis")
plot_NRt(IRSAR.RF.Data)
# Error in xy.coords(x, y) : 'x' and 'y' lengths differ
# In addition: Warning message:
# In nat[, 2]/reg[, 2] :
#  longer object length is not a multiple of shorter object length
@R-Lum R-Lum deleted a comment Aug 28, 2024
@mcol
Copy link
Contributor Author

mcol commented Aug 28, 2024

Also:

data("ExampleData.BINfileData", envir = environment())
obj <- Risoe.BINfileData2RLum.Analysis(CWOSL.SAR.Data,
                                       pos = 8, ltype = "OSL")
plot_NRt(obj[[2]])
# Error in plot_NRt(obj[[2]]) : object 'curves' not found

@mcol
Copy link
Contributor Author

mcol commented Aug 28, 2024

Here the code doesn't correspond to the error message:

Luminescence/R/plot_NRt.R

Lines 145 to 146 in 759a114

if (!any(sapply(RLum.objects, class) == "RLum.Data.Curve"))
stop(paste("The provided RLum.Analysis object must exclusively contain RLum.Data.Curve objects."), call. = FALSE)

Assuming that the message is correct, we should test for if (!all(... == ...)) or equivalently for if (any(... != ...)).

@RLumSK
Copy link
Member

RLumSK commented Aug 28, 2024

I do agree, this cannot work as intended.

@mcol
Copy link
Contributor Author

mcol commented Aug 29, 2024

Fixed by #179.

@mcol mcol closed this as completed Aug 29, 2024
@mcol mcol added this to the v0.9.25 (autumn CRAN release) milestone Sep 9, 2024
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

No branches or pull requests

2 participants