Difference between revisions of "POPs in Baltic herring"
From Testiwiki
m (→Rationale: code updated) |
m (→Rationale: updated, plots TEQ figure) |
||
Line 16: | Line 16: | ||
library(ggplot2) | library(ggplot2) | ||
library(rjags) | library(rjags) | ||
+ | library(reshape2) | ||
dat <- opbase.data("Op_en3104", subset = "POPs") | dat <- opbase.data("Op_en3104", subset = "POPs") | ||
Line 22: | Line 23: | ||
dat <- subset(dat,!(is.na(dat["Result"]))) | dat <- subset(dat,!(is.na(dat["Result"]))) | ||
dat <- dropall(dat) | dat <- dropall(dat) | ||
+ | levels(dat$POP) <- gsub("HCDD", "HxCDD", levels(dat$POP)) | ||
+ | levels(dat$POP) <- gsub("HCDF", "HxCDF", levels(dat$POP)) | ||
+ | levels(dat$POP) <- gsub("CoPCB", "PCB", levels(dat$POP)) | ||
congeners <- levels(dat$POP) #names of different congeners in data | congeners <- levels(dat$POP) #names of different congeners in data | ||
Line 55: | Line 59: | ||
#update(jags, 1000) | #update(jags, 1000) | ||
out <- coda.samples(jags, c('tau1', 'muOfCompound'), 500) # Stores a posterior sample | out <- coda.samples(jags, c('tau1', 'muOfCompound'), 500) # Stores a posterior sample | ||
− | plot(out) | + | #plot(out) |
Meanlogpost = c() | Meanlogpost = c() | ||
Line 67: | Line 71: | ||
logsd <- sqrt(1/(mean(out[[4]][,j+Y]))) | logsd <- sqrt(1/(mean(out[[4]][,j+Y]))) | ||
Sdlogpost = c(Sdlogpost, logsd) | Sdlogpost = c(Sdlogpost, logsd) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
Line 87: | Line 84: | ||
) | ) | ||
− | oprint(resultsall) | + | #oprint(resultsall) |
+ | |||
+ | tef <- Ovariable("tef", ddata = "Op_en4017", subset = "TEF values") | ||
+ | tef <- EvalOutput(tef) | ||
+ | |||
+ | colnames(resultsall)[1] <- "Congener" | ||
+ | resultsall <- melt(resultsall) | ||
+ | colnames(resultsall)[3] <- "Result" | ||
+ | resultsall <- Ovariable("resultsall", data = resultsall) | ||
+ | resultsall <- EvalOutput(resultsall) | ||
+ | teq = resultsall * tef | ||
+ | teqpart <- teq@output | ||
+ | teqpart <- teqpart[teqpart$variable == "Meanpost", ] | ||
− | ggplot( | + | ggplot(teqpart, aes(x = Congener, y = Result, fill = Congener)) + geom_bar(stat = "identity") + |
+ | labs(x = "Congener", y = "TEQ (pg/g fat)") + coord_flip() | ||
</rcode> | </rcode> |
Revision as of 08:38, 16 June 2016
This page is a variable.
The page identifier is Op_en2583 |
---|
Moderator:Nobody (see all) Click here to sign up. |
Give your opinion to the peer rating of the content of this page. |
Upload data
|
Contents
Question
What are the concentrations of persistent organic pollutants (POPs) in Baltic sea fish.
Answer
Rationale
POP concentrations in Baltic sea fish have been measured from samples collected in EU-kalat project.