MixSIAR icon indicating copy to clipboard operation
MixSIAR copied to clipboard

Load data sources with raw and Site as factor

Open Amazonersk opened this issue 3 years ago • 1 comments

Hello,

I tried to load my source_data not using the Means and SDs but the raws of my entire data and having the "Site" where the sources were sampled as the source_factors.

To summarize, I have 4 columns : Source, Site, d13C , d15N

I checked the nature of my variables: character, character, numeric, numeric, so it's fine.

But when I try to run the loading of the sources, this error message appears:

Error in list.sources.bylev[[lev]] <- SOURCE[SOURCE[, source_factors] == : attempt to select less than one element in integerOneIndex

What can I do ??

If it's possible I want to use all raws and not the Means and SDs to gain power and don't lose any information on the data.

Here is my code: '''source <- load_source_data(filename="Sources_all.csv", source_factors="Site", conc_dep=FALSE, data_type="raw", mix)"""

Here is a part of my data:

Source,d13C,d15N,Site Acrididae,-27.12,7.02,PB Acrididae,-28.67,7.87,PB Acrididae,-25.71,10.1,PB Acrididae,-26.37,9.05,PB Acrididae,-26.61,10.05,PB Acrididae,-26.86,9.73,PB

Thanks in advance for your help,

Amazone.

Amazonersk avatar Jul 19 '21 15:07 Amazonersk

I just read another post with the same issue, and it's been a problem for me too. I haven't seen any vignettes or other support files on how to format raw source data and also include a factor (sorry if I've overlooked something), so I've tried multiple formats (including the format you mention- Source, Factor, Isotope) but I always get the same error message. However, it works fine when I use mean values rather than raw data. I would love to see this question answered! Thanks so much for asking.

isotopedroughtplantnerd avatar Apr 24 '22 02:04 isotopedroughtplantnerd