MixSIAR
MixSIAR copied to clipboard
Error when plotting data
Hi Brian, when I want to plot my data (plot_data(filename = 'isospace_plot', plot_save_pdf = TRUE, plot_save_png = FALSE, mix, source, discr)) I get an error message: Error in source$S_MU[, mix$iso_names] : subscript out of bounds I have just one iso (d15N) and two different food sources: "natural" and "artificial". The last one is enriched in 15N so that I have a Meand15N of 1357.91 per mill. I´m not sure if this is a problem? But when I reduce this value to a smaler (like an other "natural") value, I also receive the error message. I don´t understand what could be wrong with my mix$iso_names... do you have any idea? Thanks! Lena
Hello Brian and MixSIAR users:
I am also getting a similar error when I try to run a one-isotope mixing model in MixSIAR. I've looked at the user manual specifically the 1-isotope snail example but didn't resolve this error. I'm trying to use a one isotope model to estimate contributions from two sources to one mixture. Weirdly enough I can get the same model to run but with two isotopes (the same two sources to the exact same mixture) and view plots and model output but when I remove d15N and use only d13C (since I'm working on a herbaceous bird species [sage-grouse] so don't need to assess impacts to trophic level just different plant carbon sources to offspring production) I get the following error:
plot_data(filename="isospace_plot", plot_save_pdf=TRUE, plot_save_png=FALSE, mix,source,discr) Error in source$S_SIG[, mix$iso_names] : subscript out of bounds --
I feel my data frames are set up correctly since I've checked them against the user manual especially the one-isotope snail example. Any ideas on possible solution? Thanks for your time and help!!!
I'm having the same problem... I can get the plot to work for the snail example, but not my own data. I suspect it's because for whatever reason the isospace plot for a single isotope wants only 'raw' vs. 'mean' source data? E.g., if you dig into mix$iso_names, it's pulling out the name of the isotope. However, if you are using a 'mean' data_type source file, it doesn't use the mix$iso_names, it uses mix$MU_names. So, the plot is looking for a column with the iso_name, not the mean. Is this intentional for some reason when you are working with a single isotope? Or is there a way to hack the plot code to get it to call mix$MU_names instead of mix$iso_names? The only other way I can see to fix it is to replace Meandel13C with del13C in the 'source' file, but I suspect that would mess things up for both the plot (as it doesn't know they are means) as well as the following modelling.
I'm assuming this is a problem just with the isospace plot, and won't be an issue when it comes to the modelling, but I'll find this out in the next day or two...
Any thoughts from anyone would be appreciated.
Update- it looks like it may also be the case that single source mixing models (or at least the isoplots written for them) don't like multiple factors. I just tried it on a single category in my data set and the plot works quite happily. Wonder if this is also why I am having issues with model convergence by providing multiple factors on my single source model... going to try running them individually and see what happens.