Closed mcol closed 2 months ago
I have a fix for the bin()
errors, but I'm stuck on the other two. The current code is very old, probably it precedes updates to the RLum
S4 classes and I can't make sense of what should be expected:
https://github.com/R-Lum/Luminescence/blob/759a1142651cc557f9fd06c6b061d1aff244cdf9/R/methods_RLum.R#L152
https://github.com/R-Lum/Luminescence/blob/759a1142651cc557f9fd06c6b061d1aff244cdf9/R/methods_RLum.R#L180
OK, this is indeed a left over, because in the past we had used the 'raster' package for the image data. Today the data
slot is an array. Now it should read:
hist.RLum.Data.Image <- function(x, ...) hist(x = get_RLum(x), ...)
hist.RLum.Data.Image <- function(x, ...) summary(x = get_RLum(x), ...)
Only problem to consider is that the array may have different dimensions. Perhaps we can use a loop for it or add something of set a dimension parameter (image slice).
Do you have an example of such image object?
data(ExampleData.RLum.Data.Image, envir = environment())
That's what I'm using, but I think it contains only one array.
I've constructed one like this: image3 <- set_RLum("RLum.Data.Image", data = array(runif(300, 0, 255), c(10, 10, 3)))
, and the methods work directly without needing loops.
Fixed by #232.
I'm going through the list of S3 methods defined in
methods_RLum()
. While most work as expected, here are some that generate errors:The
bin()
failures are probably due to the fact that there's no existingbin()
function in R, so we should set up our own generic.