You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#' @param data [data.frame] or [RLum.Results-class] object (required):
#' for data.frame: two columns: De (values[,1]) and De error (values[,2]).
#' For plotting multiple data sets, these must be provided as
#' list (e.g. list(dataset1, dataset2)).
However, the code accepts also vectors and doesn't actively check that a data.frame contains two columns:
if(is(data[[i]], "RLum.Results") ==FALSE&
is(data[[i]], "data.frame") ==FALSE&
is.numeric(data[[i]]) ==FALSE) {
.throw_error("Input data must be one of 'data.frame', ",
"'RLum.Results' or 'numeric'")
So the following errors can be generated:
plot_KDE(df[, 1])
# Error in data[[i]][, 1:2] : incorrect number of dimensions
plot_KDE(df[, 1, drop=FALSE])
# Error in `[.data.frame`(data[[i]], , 1:2) : undefined columns selected
Do we want to support these uses and update the documentation, or should we start rejecting them?
The text was updated successfully, but these errors were encountered:
the current code is already dealing with numeric vectors and 1-column data frames: in such cases, it creates a 2-column data frame by appending a column of NAs
however, currently this leads to all rows being removed, as the code calls 'na.exclude()` without checking if the second column was artificially added by us
calc_Statistics() throws a warning: "All errors are NA or zero! Automatically set to 10^-9!"
We've reached the following conclusions:
we will support numeric vectors and 1-column data frames and update the documentation accordingly
instead of adding a column of NAs, we will add a column of very small values, such as 10^(-9) so that the behaviour of calc_Statistics() will not change while silencing the warning
The docs for 'plot_KDE()' state:
However, the code accepts also vectors and doesn't actively check that a data.frame contains two columns:
So the following errors can be generated:
Do we want to support these uses and update the documentation, or should we start rejecting them?
The text was updated successfully, but these errors were encountered: