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
I am running a mixing model with a single isotope (15N) and concentration dependence. When I load the source data in using concentration dependence I get the error message:
Error in FUN(X[[i]], ...) :
'x' must be an array of at least two dimensions
That arises from the function lapply trying to calculate column means for a list with one dimensional components.
I edited the function by changing the lapply function from colMeans to mean and it appears to work well.
Does this make sense and is this a good fix?
Thanks,
Rob
CODE
if (conc_dep) {
CONC_names <- paste("Conc", mix$iso_names, sep = "")
if (sum(is.na(match(CONC_names, colnames(SOURCE)))) >
0) {
stop(paste("*** Error: Concentration dependence column names mislabeled.\n Should be 'Conc' + iso_names, e.g. 'Concd13C' if iso_names = 'd13C'.\n Please ensure Conc headings in source data file match iso_names\n in mix data file and try again. Alternatively, you may have set conc_dep=T\n by mistake.",
sep = ""))
}
CONC_iso_cols <- match(CONC_names, colnames(SOURCE))
I'm having the same issue as robertwbuchkowski and getting the error:
Error in FUN(X[[i]], ...) :
'x' must be an array of at least two dimensions
How do I access the code that robertwbuchkowski changed? Is there a filename with extension I could search for? Or is changing the code a challenging thing to do? If so, is there another workaround?
I am running a mixing model with a single isotope (15N) and concentration dependence. When I load the source data in using concentration dependence I get the error message:
Error in FUN(X[[i]], ...) :
'x' must be an array of at least two dimensions
That arises from the function lapply trying to calculate column means for a list with one dimensional components.
I edited the function by changing the lapply function from colMeans to mean and it appears to work well.
Does this make sense and is this a good fix?
Thanks,
Rob
CODE
if (conc_dep) {
CONC_names <- paste("Conc", mix$iso_names, sep = "")
if (sum(is.na(match(CONC_names, colnames(SOURCE)))) >
0) {
stop(paste("*** Error: Concentration dependence column names mislabeled.\n Should be 'Conc' + iso_names, e.g. 'Concd13C' if iso_names = 'd13C'.\n Please ensure Conc headings in source data file match iso_names\n in mix data file and try again. Alternatively, you may have set conc_dep=T\n by mistake.",
sep = ""))
}
CONC_iso_cols <- match(CONC_names, colnames(SOURCE))
}else conc <- NULL
The text was updated successfully, but these errors were encountered: