Coder Social home page Coder Social logo

simmr's Introduction

cran version rstudio mirror downloads rstudio mirror downloads Codecov test coverage R build status

Welcome to simmr!

simmr is a Bayesian stable isotope mixing model implemented in R which also uses JAGS. It is intended as a replacement to the SIAR package.

If you want the official stable version of the package from CRAN then go to R and type:

install.packages('simmr')

You can then load the package and view either the quick start or the full user manuals with:

library(simmr)
vignette("simmr")
vignette("quick_start")

Alternatively you can install the latest development version of the package in R with the commands:

if(!require(remotes)) install.packages('remotes')
remotes::install_github('andrewcparnell/simmr')

You can then load the package with

library(simmr)

... and look at the user manuals via:

vignette('simmr')
vignette('quick_start')
vignette('advanced_plotting')

simmr's People

Contributors

andrewcparnell avatar emmagovan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simmr's Issues

three-tracer models: inconsistent inputs.

I am running a three-tracer model where each sample has values from tracers one and two, but only occasional values for tracer 3. For example:

Sample Tracer 1 Tracer 2 Tracer 3
1 -21 -8 NA
2 -20 -8 -2
3 -19 -8 -1

The model is based on the standard SIMMR script. Despite inconsistent availability, the model is improved with the addition of tracer three. I gather that this is because the algorithm is run for each tracer independently, with proportions then being calculated for each tracer. I'm a bit lost in the maths on how the three tracers are then combined to provide an overall estimate of source contribution to the mixture.

Is there a clear explanation of this process?

Controlling X-axis ticks in plot(simmr_groups_out,type='boxplot')

Dear Andrew

firstly thanks for the nice, fast mixing model.
I have a plotting question, e.g. with this function plot(simmr_groups_out,type='boxplot',group=1,title='simmr output group 1')

I'm probably being really stupid, but is there a quick way to force the boxplots to have a similar format for x axis tick intervals? I have mixing model outputs for 4 groups. For three, the ticks intervals are every 0.25, but for one it's 0.2! obviously, I'd like to get them all in a common format.

Cheers
Chris

Combining sources a posteriori #5

Hello,
I started using simmr package and would like to combine two sources with similar isotopic values using

"simmr_groups_out_combine = combine_sources (simmr_groups_out,
to_combine = c ('Formicidae', 'Lepidoptera'),
new_source_name = 'For + Lep')

Would there be any way to use this new source in the "compare_groups" command?
I failed with "compare_groups (simmr_groups_out, source = 'For + Lep', groups = 1: 3)

Tks

simmr posterior_predictive

@andrewcparnell --another question! I finally have my complete dataset (18N and 15O isotopes for groundwater samples). My output for the posterior_predictive for a first trial with a subset of wells results in this:

print(post_pred)
$table
interval.1 interval.2 data outside
1 1.366803 4.299307 1.3 TRUE
2 5.259295 8.197375 6.0 FALSE

$prop_outside
[1] 0.5

I need to dig into the model output, but as a first cut, is this telling me half (50%) of the data fall outside the model results?

Thank you.

Changing limits on Y axis for compare_groups

Hi Andrew,
Your mixing model simmr is a huge help in our work

I have outputted some nice box plots with the compare_groups function. However, I cant figure out how to change the default title, nor the limit on the y-axis.

I am familiar with ggplot routines, but I can't seem to feed the plot output into ggplot.

Can you offer any advice?
Thanks!
Craig Duxbury

Siarplotdata(...) just for one group

Thank you for your great package. However, when I just divided one group in my data frame of "consumers", the x-aixs in the plot appears "group" but not "d15N" or "d13C"in theory. The problem would disappear in multi-group version. I also found other people faced the same issue.
AndrewLJackson/siar#6
rplot03

Prediction Intervals as Gauge of Model Fit

    Hi @Craigdux. Thanks for the query. The idea of this table is that, if the model is doing a good job capturing the uncertainty in the data, then approximately 50% of the observations should lie outside the 50% prediction intervals. For your data this is exactly what you're getting so this would give you confidence that the model is fitting well. 

However, you do only have two observations so it's not a particularly robust statistic. I would recommend only really using this tool if you have at least 10 observations, and preferably more.

Originally posted by @andrewcparnell in #33 (comment)

Can I combine more than 2 pairs of sources?

Hi Andrew,

I was wondering if it is possible to (a-posteriori) combine more than 1 pair of sources in simmr, e.g. to combine 2 sources into 1, and two other sources into another one? If so, how can i go about it?
Cheers!!

Geese groups

In the section titled Running simmr on multiple groups the dataset called geese_data does not have a grouping element. Therefore, this part of the vignette cannot be recreated.

incompatibility issue with simmr crashes RStudio in R-4.1.0

Using library simmr with R-4.1.0 crashes RStudio when attempting plot statements (on Linux). Seems to be an issue with one of the dependencies (JAGS, coda or both?). Working solution is to use earlier version of R (in RStudio), or to run R-4.1.0 in terminal mode.

Combine_sources error

Hello,

I'm getting an error when combining sources with combine_sources( ):

Error` in `[<-`(`*tmp*`, to_combine_cols[1], , value = apply(old_source_means[to_combine_cols,  : 
  subscript out of bounds"

My data is composed of two groups, 2 isotopes, 4 sources, and I want to combine sources 3 and 4.

I went digging a bit into the function, and I think I've spotted the problem, and it works for me after the change, but I don't dare to commit it as maybe I've missed something. Here's the deal:

In

# 1 combine the chosen source means
old_source_means = simmr_out$input$source_means
simmr_new_out$input$source_means = old_source_means[-to_combine_cols[2], ,
                                                               drop = FALSE]
simmr_new_out$input$source_means[to_combine_cols[1], ] = apply(old_source_means[to_combine_cols, ,drop = FALSE], 2, 'mean')

I've changed the [1] in the last line by a [2], so I've got

# 1 combine the chosen source means
old_source_means = simmr_out$input$source_means
simmr_new_out$input$source_means = old_source_means[-to_combine_cols[2], ,
                                                  drop = FALSE]
simmr_new_out$input$source_means[to_combine_cols[2], ] = apply(old_source_means[to_combine_cols, ,drop = FALSE], 2, 'mean')

If this is done in steps 1 through 5, the results seem to me to be what I expected, and the function doesn't crash.

I've tried this with other datasets and other computers with different R versions, and have got the same error, so I guess the error is not in the data or the session. Just in case, below is my session info, and I can send the data over if anyone wants to test it.


R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252
[3] LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C
[5] LC_TIME=Spanish_Spain.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base

other attached packages:
[1] simmr_0.3 ggplot2_3.0.0 rjags_4-6 coda_0.19-2

loaded via a namespace (and not attached):
[1] Rcpp_0.12.19 pillar_1.2.2 compiler_3.5.0
[4] DEoptimR_1.0-8 plyr_1.8.4 bindr_0.1.1
[7] viridis_0.5.1 compositions_1.40-2 tools_3.5.0
[10] digest_0.6.15 boot_1.3-20 viridisLite_0.3.0
[13] tibble_1.4.2 gtable_0.2.0 lattice_0.20-35
[16] pkgconfig_2.0.1 rlang_0.2.0 yaml_2.1.19
[19] bindrcpp_0.2.2 gridExtra_2.3 withr_2.1.2
[22] dplyr_0.7.6 stringr_1.3.0 grid_3.5.0
[25] tidyselect_0.2.4 glue_1.2.0 robustbase_0.93-2
[28] R6_2.2.2 bayesm_3.1-0.1 tensorA_0.36.1
[31] purrr_0.2.4 reshape2_1.4.3 magrittr_1.5
[34] scales_0.5.0 MASS_7.3-49 assertthat_0.2.0
[37] colorspace_1.3-2 labeling_0.3 stringi_1.1.7
[40] energy_1.7-5 lazyeval_0.2.1 munsell_0.4.3

--

## sd_d13C ?

Hi, Andrew.

First of all, I want to thank you for this package, it's amazing!
I'm working with it and a question arose: when I run the model, exploring the results I found ## sd_d15N and ## sd_d13C
What do they mean? Because the standard deviation of the sources has already been given
I apologize if the questioning is basic, is that it really is disturbing me a little

Thank you in advance for the help

Maria

Different order and colours for sources

Dear Andrew,

I am trying to change the default order and colours for the sources in simmr_in and simmr_out plots but I cannot find a way to do so. Could you please help me out?

Thank you!

Ninon

Issue with "combine_sources" function

Hello, I am having trouble with the "combine_sources" function in simmr.

Below is my code for getting up to this point with the example geese data included in simmr:

Load example data into R

path = system.file("extdata", "geese_data.xls", package = "simmr")
geese_data = lapply(excel_sheets(path), read_excel, path = path)

Separate the data into parts

targets = geese_data[[1]]
sources = geese_data[[2]]
TEFs = geese_data[[3]]
concdep = geese_data[[4]]

Load the data into simmr

geese_simmr = simmr_load(mixtures = as.matrix(targets[, 1:2]),
source_names = sources$Sources,
source_means = sources[,2:3],
source_sds = sources[,4:5],
correction_means = TEFs[,2:3],
correction_sds = TEFs[,4:5],
concentration_means = concdep[,2:3],
group = as.factor(paste('Day', targets$Time)))

Plot the data in isospace

plot(geese_simmr, group = 1:8)

Run through simmr

geese_simmr_out = simmr_mcmc(geese_simmr)

Combine sources

simmr_out_combine = combine_sources(geese_simmr_out,
to_combine = c('U.lactuca',
'Enteromorpha'),
new_source_name = 'U.lac+Ent')

When trying to run this combine_sources step, the following error message appears:

Error: Assigned data apply(old_source_means[to_combine_cols, , drop = FALSE], 2, "mean") must be compatible with row subscript to_combine_cols[1].
x 1 row must be assigned.
x Assigned data has 2 rows.
ℹ Row updates require a list value. Do you need list() or as.list()?

Thank you for your assistance!

Output table

Hi,

I'm new to using SIMMR - I was wondering if there is a way to create an output table with the diet proportions of the used sources per individual target?

Thank you :)

Understanding posterior predictive results

Dear Andrew,

We are currently working on a 2 sources simmr model: the mix is river particulate organic matter (we have a few different models corresponding to different sampling dates) and we have terrestrial material and phytoplankton as sources. So far the models run well and we have no major issues but interpreting the posterior predictive outputs $prop_outside and its plot from the posterior_predictive() function.

As expected, we obtain results that are either 0, 0.5 or 1. From what we understand, if 0 it means the data point (y) broadly lie in the fitted value intervals (Yrep), if 0.5 then only one data point is out, if 1, then both datapoints are outside the fitted value interval.

We are not sure we understood what is the fitted value interval and if we can consider our models as good or not regarding our results. Could you give us some lights about it (or some papers to read)?

So far, what we concluded about our model results are:

When checking the isospace plots, we understand that when we get a 0 it means the mix lie within the 'line' (between the 2 sources, no real 'polygon') and when we got 0.5 or 1 we find the mix to lie outside the 'line' between our two sources (often included in the standard deviation of one source but not the other). So the 'problem' might come from our input data.

1M$ question .... what is a polygon when we only have 2 sources? Does it include as well the standard deviation bars, instead of just being a simple 'line'? so can we consider that even if our mix is within only one standard deviation, the model outputs are alright?

To our opinion these models (giving 0.5 or 1 as posterior predictive outputs) are not especially bad ones, because model chain convergence diagnostics (Gelman) are good and the posteriors plots look all right (distribution is not to wide, there is only one peak and it is quite narrow most of the time).

Would you agree to consider these results ok to be interpreted?

Thank you in advance for your help.

Kind regards,

Florian

Different results with same data between old and new release

Dear developers, I really appreciate simmR and use it for my research to solve environmental problems. However, I am having some troubles lastly. I obtained very different results using simmR with similar data that I already analyzed last year or some months ago. I am wondering if the new release/update may be the reason? This is quite challenging because it may totally change the conclusion of our work. Thanks in advance, Best regards

Running simmr on mean values for consumers?

Hi,

I am trying to use previously published dataset for a meta-analysis. Usually, only mean + sd values per sampling site are provided for consumers and sources. The CRAN page says that "simmr can handle [...]
A single consumer. This may occur when you have only one data point on a single individual". Does this mean that you can run the model on only one observation? By extension can I run simmr on one mean value and is there a way to take into account the sd?

Thank you very much
Best regards

error code error in data frame yet everything appears correct?

Hi,

I successfully used Simmr for an individual consumer but when I tried to do it for the  4 consumers altogether I kept getting the error below. I have triple, quadruple checked everything (so hopefully I have found all the obvious errors!)  - and when I searched for errors fix,  it lead to bugs in being in  ggplot. So I am wondering if this is a bug?

This comes up after this code:

simmr_groups = simmr_load(mixtures=mix,
source_names=s_names,
source_means=s_means,
source_sds=s_sds,
group=grp)

Error in [[<-.data.frame(*tmp*, aes, value = c(0, 0, 0, 0, 1, 1, 1, :
replacement has 10 rows, data has 7
Thanks for your help!

Group names

Request to add in flexibility in groups so they can be character vectors rather than forced to be integers.

simmr_load error

Hi all,

I keep getting the following error when attempting to load my mixture and source data into simmr:

Error in simmr_load(mixtures = mix, source_names = source_names, source_means = source_means, :
Assertion on 'mixtures' failed: Must be of type 'matrix', not 'tbl_df/tbl/data.frame'.

Here is the entire code:

targets = read_excel("Practice.xlsx", sheet = 1)
sources = read_excel("Practice.xlsx", sheet = 2)
TEFs = read_excel("Practice.xlsx", sheet = 3)
as.matrix(targets)
as.matrix(sources)
as.matrix(TEFs)

mix=targets[, 1:2]
colnames(mix) = c('d13C','d15N')
source_names = c("Menhaden", "Sand Lance", "Mackerel")
source_means = sources[,2:3]
source_sds = sources[,4:5]
correction_means = TEFs[,2:3]
group = as.factor(paste('StrandingState', targets$StrandingState))

simmr_in = simmr_load(mixtures=mix,
source_names=source_names,
source_means=source_means,
source_sds=source_sds,
correction_means=TEFs)

All packages and Rstudio are updated to the latest versions. Any help would be greatly appreciated!

Using simmr with data.frames wrong labels in plot

I am trying to use simmr with the same old siar example files

sources <- read.table("sourcesdemo.txt",header=TRUE,stringsAsFactors = F)
consumers <- read.table("geese1demo.txt",header=TRUE)
corr <- read.table("correctionsdemo.txt",header=TRUE,stringsAsFactors = F)

sm1 <- simmr_load(mixtures=as.matrix(consumers),
           source_names=sources$Means,
           source_means = sources[,c(2,4)],
           source_sds = sources[,c(3,5)],
           correction_means = corr[,c(2,4)],
           correction_sds = corr[,c(3,5)]
           )

print(sm1)

plot(sm1)

But the labels of the plot seems to be wrong

image

you could find the text files I am using in https://github.com/AndrewLJackson/SIAR-examples-and-queries/tree/master/siar-mixing-models

Thanks!

Help pages: geese_data and geese_data_day_1

The descriptions of the geese_data() and geese_data_day_1() functions state:
"A real Geese data set with 251 observations on 2 isotopes, with 4 sources, and with corrections/trophic enrichment factors (TEFs or TDFs), and concentration dependence means. Taken from Inger et al (2016). See link for paper"

"A real Geese data set with 9 observations on 2 isotopes, with 4 sources, and with corrections/trophic enrichment factors (TEFs or TDFs), and concentration dependence means. Taken from Inger et al (2016). See link for paper"

However, the paper appears to be from 2006, not 2016 unless I am mistaken?

Combining sources a posteriori

Andrew Jackson had written some code to combine source output as posteriori in SIAR. Is there a way to do this with SIMMR output?

Trying to use coda, is $output an mcmc.list object?

I am not an expert using coda but I would like to view a traceplot so I tried this

sources <- read.table("sourcesdemo.txt",header=TRUE,stringsAsFactors = F)
consumers <- read.table("geese1demo.txt",header=TRUE)
corr <- read.table("correctionsdemo.txt",header=TRUE,stringsAsFactors = F)

sm1 <- simmr_load(mixtures=as.matrix(consumers),
           source_names=sources$Means,
           source_means = sources[,c(2,4)],
           source_sds = sources[,c(3,5)],
           correction_means = corr[,c(2,4)],
           correction_sds = corr[,c(3,5)]
           )

sm1_out = simmr_mcmc(sm1)

require(coda)

traceplot(sm1_out$output)

is.mcmc.list(sm1_out$output)

it seems that sm1_out$output is not an mcmc.list object

thanks!

Large differences in results with "normal" simmr and simmr solo

Hi Andrew,
I've got yet another question about simmr. For example, if I run this model (script below) with 2 mixture samples, I get a contibution of seagrass of 3-81% (95% CI). This lower bound of the 95% CI sounds a bit low to me given the position of the mixtures on the d13C-d15N plane... Anyway, If I then go and run the model using simmr solo based on 1 only sample, that has d13C and d15N that correspond to the average of those 2 initial samples (d13C = -11.4, d15N=8.15), I get a much more constrained result on seagrass contribution: 64-84%. Looking at the plot, that one makes more sense. I realise the source polygon in this case is a bit funny, but can't explain the large difference in results, can you help please?
THANK YOU!

mix = matrix(c(-11.8, -11.0, 8.1, 8.2), ncol=2,nrow=2)
colnames(mix) = c('d13C','d15N')
s_names = c("Seagrass", "Mangroves","MPB", "Saltmarsh")
s_means = matrix(c(-10.1,-27.3,-19.2,-25.7,1.4,2.3,3.4,6.0), ncol=2, nrow=4)
s_sds = matrix(c(0.3, 1.5, 1.5, 0.7, 2.4, 0.2, 1.5, 2.1), ncol=2, nrow=4)
c_means = matrix(c(1.7, 1.7, 1.7, 1.7, 5.6, 5.6, 5.6, 5.6), ncol=2, nrow=4)
c_sds = matrix(c(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5), ncol=2, nrow=4)

simmr_in = simmr_load(mixtures=mix,
source_names=s_names,
source_means=s_means,
source_sds=s_sds,
correction_means=c_means,
correction_sds=c_sds)
simmr_out = simmr_mcmc(simmr_in)

plot(simmr_in,xlab=expression(paste(delta^13, "C (\u2030)",sep="")),
ylab=expression(paste(delta^15, "N (\u2030)",sep="")),
title='Aldrichetta (P Davis) Summer')

summary(simmr_out,type='statistics')
summary(simmr_out,type='quantiles')

Return plot output of compare_groups

It would be nice to be able to easily access the results of the plot=TRUE from compare_groups(), unless I'm missing something at the moment there's no way to make changes to the resulting ggplot object since it is printed.

I added return(p) to the Return output section of the function and it does what I needed, allowing me to pass subsequent ggplot arguments to the output e.g.

compare_groups(simmr_groups_out, source_name = "Zostera", groups = 1:2, plot=TRUE) + labs(x="New Label")

Issue for loading simmr data

I have an error when I try to load simmr data. All my objects are checked and seem good but I keep having the same error message :
Error: Assertion failed. One of the following must apply:

  • test_data_frame(x): FALSE
  • test_matrix(x): FALSE
  • test_tibble(x): FALSE

Script :
consumers <- read_xlsx ("Consommer.xlsx")
sources <- read_xlsx("Sources.xlsx")
TEFs <- read_xlsx("TEFs.xlsx")
sources$Meand13C<- as.numeric(sources$Meand13C)
sources$Meand15N<- as.numeric(sources$Meand15N)
sources$Sdd15N<- as.numeric(sources$Sdd15N)
sources$Sdd13C<- as.numeric(sources$Sdd13C)
sources<- na.omit(sources)

mixtures <- as.matrix(consumers[-1, 2:3])

source_names <- as.character(sources$Source)

source_means <- cbind(sources$Meand13C, sources$Meand15N)

source_sds <- cbind(sources$Sdd13C, sources$Sdd15N)

correction_means <- cbind(TEFs$Meand13C, TEFs$Meand15N)

correction_sds <- cbind(TEFs$Sdd13C, TEFs$Sdd15N)

print(dim(mixtures))
print(class(mixtures))
print(class(source_names))
print(dim(source_means))
print(dim(source_sds))
print(dim(correction_means))
print(dim(correction_sds))

simmr_input <- simmr_load(
mixtures = mixtures,
source_names = source_names,
source_means = source_means,
source_sds = source_sds,
correction_means = correction_means,
correction_sds = correction_sds,
concentration_means = NULL
)

Plot quantiles

Good morning!

Is there a way to plot the quantiles using simmr code ...I can extract the results from the summary function and make a ggplot version but wondering if there's a simpler way ? It would be nice to have boxplots but with quantiles for manuscripts for each prey type. Rather then the simmr output plots

Thanks!

problem with summary() for simmr_out object

Hi Andrew,

First, thanks for all the work you put into this package. I'm running 0.4.1, which is the most recent I could get from CRAN, and came across errors while re-running some scripts that worked about a year ago. When attempting to view the convergence statistics, this error is thrown:

summary(susp_out, type = "diagnostics")
Summary for 1
Error in apply(out_all, 2, "quantile", probs = c(0.025, 0.25, 0.5, 0.75, :
dim(X) must have a positive length

The creation of the simmr_out object susp_out = simmr_mcmc(simmr_groups_susp) appears to work correctly and the list object looks normal upon basic inspection.

From here onward, there are errors thrown for every call of the susp_out object.

posterior_predictive(susp_out)
Error in simmr_out$output[[group]]$model$model() :
attempt to apply non-function

summary(susp_out, type='quantiles', group_num=1)
Summary for 1
Error in apply(out_all, 2, "quantile", probs = c(0.025, 0.25, 0.5, 0.75, :
dim(X) must have a positive length

susp.summ <- summary.simmr_output(susp_out, type=c("quantiles"), group=c(1:max(susp$Code)))
Error in summary.simmr_output(susp_out, type = c("quantiles"), group = c(1:max(susp$Code))) :
could not find function "summary.simmr_output"

Any ideas why the summary calls don't work? THANK YOU so much for you help. Let me know if you would like a reproducible example.

Best regards,
Nathan

Cannot load simmr due to JAGS issue

Hi all,

I have Windows 10 and am using the latest version of Rstudio. I am trying to load the simmr package and I get the following error:

Loading required package: R2jags Loading required package: rjags
Error: package or namespace load failed for ‘rjags’: .onLoad failed in loadNamespace() for 'rjags', details: call: fun(libname, pkgname) error:
The environment variable JAGS_HOME is set to C:/Program Files/JAGS/JAGS-3.4.0 but no JAGS installation can be found there
Error: package ‘rjags’ could not be loaded In addition:
Warning messages: 1: package ‘simmr’ was built under R version 3.6.3
2: package ‘R2jags’ was built under R version 4.2.2
3: package ‘rjags’ was built under R version 4.2.2

It seems that the main error is due to not being able to load rjags. I have tried downloading 3 different versions of JAGS on my PC and none of them solved the problem. I also tried loading rjags directly from the library and I received the following error:

Error: package or namespace load failed for ‘rjags’:
.onLoad failed in loadNamespace() for 'rjags', details:
call: fun(libname, pkgname)
error: The environment variable JAGS_HOME is set to
C:/Program Files/JAGS/JAGS-3.4.0
but no JAGS installation can be found there
In addition: Warning message:
package ‘rjags’ was built under R version 4.2.2

I am not sure why it says no JAGS installation can be found at that path, because it is definitely in there. Has anyone else experienced and solved this issue?

Unable to produce matrix plots by group after combining sources a posteriori

Hi Andrew,

I'm currently working on a project where I'd like to combine sources a posteriori. I'm working with a fairly large number of groups (around 20).

After using combine_sources(), I noticed that while compare_groups() behaved exactly like I was expecting it to, compare_sources() and plot() seem to ignore the group argument: no matter which group I specify, I get the same plots and results every time.

I tried that on multiple example datasets with 1, 2 or 3 tracers, the issue occurred in each of them.

What's bugging me is that I cannot produce matrix plots which I use a lot as diagnostic tools. Any idea what's happening here?

Thanks in advance

Loïc

Accessing Raw Output Data in SIMMR

Can I access the raw output data in SIMMR (simmr_out)? There were instructions in the SIAR "Ecologist's Guide" section 4.3.5 for accessing the raw data (e.g., to compute an additional summary stat). I tried the same script in SIMMR:
out<-simmr_out$output
and tried to view the data using:
fix(out)
This did open a text editor with many values separated by commas, but they are not in any sort of column format (as described in the SIAR manual), so I'm not sure what the data represent. By the way, I have 6 sources for one individual.
Thanks!

Group simmr output boxplot are always the same

I am trying to produce output boxplots for groups of consumers but no matter which group I specify, it is always the same boxplot that is produced.

#Reading data
simmr_groups <- readRDS(file="mydata.rds")

plot(simmr_groups,group=1:4,xlab=expression(paste(delta^13, "C (\u2030)",sep="")),
ylab=expression(paste(delta^15, "N (\u2030)",sep="")),mix_name='Pekan')

simmr_groups_out = simmr_mcmc(simmr_groups)

#Combining sources
simmr_out_combine = combine_sources(simmr_groups_out,
to_combine=c('Bleuet','Sorbier'),
new_source_name='BleuetSorbier')
simmr_out_combine = combine_sources(simmr_out_combine,
to_combine=c('BleuetSorbier','Lievre'),
new_source_name='Berries & Hare')
simmr_out_combine = combine_sources(simmr_out_combine,
to_combine=c('Campagnol','Souris'),
new_source_name='Small rodents')
simmr_out_combine = combine_sources(simmr_out_combine,
to_combine=c('Castor','Porcepic'),
new_source_name='Large rodents')
simmr_out_combine = combine_sources(simmr_out_combine,
to_combine=c('cerf','Orignal'),
new_source_name='Cervids')
simmr_out_combine = combine_sources(simmr_out_combine,
to_combine=c('Ecureuil','Polatouche'),
new_source_name='Medium rodents')

#Plots for all consumers work fine
plot(simmr_out_combine$input)

plot(simmr_out_combine,type='boxplot',title='simmr output: combined sources')

#Plots for each groups show the general plot for all consumers independently of which group I specify
plot(simmr_out_combine,
type = 'boxplot',
title = 'simmr output: combined sources',
group = 1)

plot(simmr_out_combine,
type = 'boxplot',
title = 'simmr output: combined sources',
group = 2)

plot(simmr_out_combine,
type = 'boxplot',
title = 'simmr output: combined sources',
group = 3)

plot(simmr_out_combine,
type = 'boxplot',
title = 'simmr output: combined sources',
group = 4)

I attached my simmr input data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.