|
|
Line 93: |
Line 93: |
| conc_mehg <- Ovariable( | | conc_mehg <- Ovariable( |
| "conc_mehg", | | "conc_mehg", |
| dependencies = data.frame(Name="Hg", Ident="Op_en4004/Hg"), | | dependencies = data.frame(Name="Hg", Ident="Op_en4004/Hg2"), |
| formula = function(...) { | | formula = function(...) { |
| out <- Hg[(Hg$Helcom.alue %in% c("C-Selkämeri","F-Suomenlahti") |
| | |
| Hg$Naytelaji %in% c("lohi","kirjolohi")) & !is.na(Hg$Result), -5]
| | out <- data.frame() |
| out <- merge(out[out$Parameter=="MeanLog",], out[out$Parameter=="SDLog",], by=c("Helcom.alue","Naytelaji")) | | for(i in 1:nrow(Hg)) { |
| tmp <- data.frame()
| |
| for(i in 1:nrow(out)) { | |
| if(openv$N>1) { | | if(openv$N>1) { |
| tmp2 <- data.frame( | | tmp <- data.frame( |
| Iter=1:openv$N, | | Iter=1:openv$N, |
| Result=10^rnorm(openv$N, out$Result.x[i], out$Result.y[i]) | | Result=10^rnorm(openv$N, Hg$MeanLog[i], Hg$SDLog[i]) |
| ) | | ) |
| } else { | | } else { |
| tmp2 <- data.frame(Result = 10^out$Result.x[i]) | | tmp <- data.frame(Result = 10^out$Hg$MeanLog[i]) |
| } | | } |
| tmp <- rbind(tmp, | | out <- rbind(out, |
| data.frame(Area=as.character(out$Helcom.alue[i]), | | data.frame(Area=as.character(Hg$Area[i]), |
| Kala=as.character(out$Naytelaji[i]), | | Kala=as.character(Hg$Kala[i]), |
| tmp2 | | tmp |
| ) | | ) |
| ) | | ) |
| } | | } |
| tmp$Area[tmp$Area=="C-Selkämeri"] <- "Suomi"
| | out <- Ovariable(output=out, marginal=colnames(out) != "Result") * |
| tmp$Area[tmp$Area %in% c("","F-Suomenlahti")] <- "Porvoo"
| |
| out <- Ovariable(output=tmp, marginal=colnames(tmp) != "Result") * | |
| Ovariable( | | Ovariable( |
| output = data.frame( | | output = data.frame( |
Revision as of 09:31, 24 February 2021
Question
What are the current total mercury concentrations in different fish species in Finland?
Answer
{{#opasnet_base_link:Op_en4004}}
The results contain e.g. the KERTY database with thousands of mercury measurements from different parts of Finland, both inland lakes and the Baltic Sea.
Rationale
Data
The table below is data from EU-kalat 1 project (2003), and the values are about Baltic herring. (Other fish species were measured but data are not here).[1]
Mercury in Baltic herring(mg /kg f.w.)Obs | Age | Size | Concentration |
---|
1 | 1 | 1 | 0.0005 |
2 | 2 | 1 | 0.0005 |
3 | 3 | 1 | 0.0005 |
4 | 2 | 1 | 0.005 |
5 | 2 | 4 | 0.005 |
6 | 5 | 2 | 0.006 |
7 | 2 | 1 | 0.007 |
8 | 1 | 1 | 0.008 |
9 | 2 | 1 | 0.008 |
10 | 3 | 2 | 0.008 |
11 | 3 | 2 | 0.008 |
12 | 2 | 2 | 0.009 |
13 | 3 | 2 | 0.009 |
14 | 3 | 3 | 0.01 |
15 | 2 | 2 | 0.011 |
16 | 3 | 2 | 0.011 |
17 | 1 | 1 | 0.012 |
18 | 2 | 1 | 0.014 |
19 | 4 | 2 | 0.015 |
20 | 4 | 3 | 0.015 |
21 | 1 | 1 | 0.018 |
22 | 3 | 2 | 0.018 |
23 | 2 | 1 | 0.02 |
24 | 2 | 2 | 0.021 |
25 | 2 | 2 | 0.022 |
26 | 4 | 2 | 0.022 |
27 | 6 | 4 | 0.022 |
28 | 8 | 4 | 0.024 |
29 | 6 | 3 | 0.025 |
30 | 5 | 2 | 0.026 |
31 | 4 | 3 | 0.027 |
32 | 5 | 4 | 0.027 |
33 | 8 | 4 | 0.027 |
34 | 6 | 4 | 0.028 |
35 | 5 | 3 | 0.03 |
36 | 2 | 1 | 0.031 |
37 | 7 | 5 | 0.031 |
38 | 3 | 2 | 0.033 |
39 | 10 | 4 | 0.033 |
40 | 6 | 3 | 0.038 |
41 | 10 | 5 | 0.038 |
42 | 12 | 5 | 0.039 |
43 | 6 | 4 | 0.04 |
44 | 5 | 5 | 0.043 |
45 | 7 | 5 | 0.043 |
46 | 7 | 4 | 0.048 |
47 | 6 | 3 | 0.049 |
48 | 6 | 3 | 0.049 |
49 | 3 | 2 | 0.051 |
50 | 9 | 5 | 0.054 |
51 | 9 | 4 | 0.066 |
52 | 7 | 5 | 0.069 |
53 | 3 | 5 | 0.072 |
54 | 11 | 4 | 0.083 |
55 | 11 | 5 | 0.107 |
Calculations
conc_mehg for PFAS disease burden
This code was developed for op_fi:PFAS-yhdisteiden tautitaakka. It contains all fish species from Hg table but only Gulf of Finland and Bothnian Bay as areas.
+ Show code- Hide code
# This is code Op_en4004/conc_mehg_allfish on page [[Mercury concentrations in fish in Finland]]
library(OpasnetUtils)
conc_mehg <- Ovariable(
"conc_mehg",
dependencies = data.frame(Name="Hg", Ident="Op_en4004/Hg2"),
formula = function(...) {
out <- data.frame()
for(i in 1:nrow(Hg)) {
if(openv$N>1) {
tmp <- data.frame(
Iter=1:openv$N,
Result=10^rnorm(openv$N, Hg$MeanLog[i], Hg$SDLog[i])
)
} else {
tmp <- data.frame(Result = 10^out$Hg$MeanLog[i])
}
out <- rbind(out,
data.frame(Area=as.character(Hg$Area[i]),
Kala=as.character(Hg$Kala[i]),
tmp
)
)
}
out <- Ovariable(output=out, marginal=colnames(out) != "Result") *
Ovariable(
output = data.frame(
Kala = c("ahven","hauki","kampela","kilkki","kirjolohi","lahna","lohi","made","silakka","simput (Cottus sp.)",
"särki","turska","vaellussiika","härkäsimppu","kilohaili","kuha","pasuri"),
Fish = c("Perch","Pike","Flounder","Chaetiliidae","Rainbow trout","Bream","Salmon","Burbot","Herring","Cottidae",
"Roach","Average fish","Whitefish","Fourhorn sculpin","Sprat","Pike-perch","White bream"),
Result = 1
),
marginal=c(TRUE,TRUE,FALSE)
)
return(out)
},
unit = "ug/g fresh weight"
)
objects.store(conc_mehg)
cat("Ovariable conc_mehg stored.\n")
| |
conc_mehg for Goherr assessment
This code contains only Baltic herring and salmon as fish species.
+ Show code- Hide code
# This is code Op_en4004/conc_mehg on page [[Mercury concentrations in fish in Finland]]
library(OpasnetUtils)
conc_mehg <- Ovariable(
"conc_mehg",
dependencies = data.frame(
Name = c("Hg"),
Ident = "Op_en4004/Hg" # [[Mercury concentrations in fish in Finland]] Contains Kerty measurements
),
formula = function(...) {
test <- paste(Hg$Parameter, Hg$Naytelaji, Hg$Helcom.alue)
meanSalm <- Hg$Result[test == "MeanLog lohi "]
meanHerrN <- Hg$Result[test == "MeanLog silakka C-Selkämeri"]
meanHerrS <- Hg$Result[test == "MeanLog silakka H-Pohjoinen Itämeri"]
sdSalm <- Hg$Result[test == "SDLog lohi "]
sdHerrN <- Hg$Result[test == "SDLog silakka C-Selkämeri"]
sdHerrS <- Hg$Result[test == "SDLog silakka H-Pohjoinen Itämeri"]
N <- openv$N
out <- data.frame(
Exposure_agent = "MeHg", # Assuming all mercury in fish is methylmercury
Fish = rep(c("Herring", "Salmon"), each = N),
Iter = rep(1:N, 2),
Country = rep(c("FI", "SE", "DK", "EE"), each = 2*N),
Result = 10^c(
rnorm(N, meanHerrN, sdHerrN),
rnorm(N, meanSalm, sdSalm),
rnorm(N, meanHerrS, sdHerrS),
rnorm(N, meanSalm, sdSalm),
rnorm(N, meanHerrS, sdHerrS),
rnorm(N, meanSalm, sdSalm),
rnorm(N, meanHerrS, sdHerrS),
rnorm(N, meanSalm, sdSalm)
)
)
return(Ovariable(
output=out,
marginal=colnames(out) %in% c("Exposure_agent","Fish","Country")
))
}
)
objects.store(conc_mehg)
cat("Ovariable conc_mehg stored.\n")
| |
- 6.10.2017 data.frame Hg initiated [2]
+ Show code- Hide code
# This is code Op_en4004/Hg on page [[Mercury concentrations in fish in Finland]]
library(OpasnetUtils)
Hg <- opbase.data(
"Op_en4004",
subset = "Kerty database"
# include = list(Naytelaji = c("lohi", "silakka")) # Probably ä in the title causes trouble
)[c(8,9,12,15,16,17,20,21,22)]
Hg$Conc <- as.numeric(as.character(Hg$Tulos))
Hg <- Hg[!is.na(Hg$Conc),]
Hg$Year <- as.numeric(as.character(substr(Hg$Alkupäivä, 7,8)))
Hg$Century <- ifelse(Hg$Year < 18, 2000, 1900)
Hg$Year <- Hg$Century + Hg$Year
colnames(Hg)[4] <- "Naytelaji" # remove ä
Hg[Hg$Naytelaji == "lohi" , "Helcom-alue"] <- ""
oprint(aggregate(Hg["Conc"], by = Hg[c("Helcom-alue", "Naytelaji")], FUN=length))
oprint(aggregate(
Hg["Conc"],
by = Hg[c("Naytelaji", "Century")],
FUN=length
))
Hg <- rbind(
data.frame(
Parameter = "Mean",
aggregate(Hg$Conc, by = Hg[c("Helcom-alue", "Naytelaji")], FUN=mean)
),
data.frame(
Parameter = "SD",
aggregate(Hg$Conc, by = Hg[c("Helcom-alue", "Naytelaji")], FUN=sd)
),
data.frame(
Parameter = "MeanLog",
aggregate(log10(Hg$Conc), by = Hg[c("Helcom-alue", "Naytelaji")], FUN=mean)
),
data.frame(
Parameter = "SDLog",
aggregate(log10(Hg$Conc), by = Hg[c("Helcom-alue", "Naytelaji")], FUN=sd)
),
data.frame(
Parameter = "N",
aggregate(Hg$Conc, by = Hg[c("Helcom-alue", "Naytelaji")], FUN=length)
)
)
colnames(Hg)[colnames(Hg)=="x"] <- "Result"
Hg$Compound <- "Mercury (µg/g)"
oprint(Hg)
objects.store(Hg)
cat("Data.frame Hg stored.\n")
| |
Updated Hg code
There was a unit conversion error in the Hg code, so an update was made on 2021-02-24 [3].
+ Show code- Hide code
# This is code Op_en4004/Hg2 on page [[Mercury concentrations in fish in Finland]]
library(OpasnetUtils)
Hg <- opbase.data(
"Op_en4004", subset = "Kerty database")[c(8,9,12,15,16,17,20,21,22)]
Hg <- Hg[Hg$Näyteosa=="lihas",]
Hg$Tulos <- as.numeric(as.character(Hg$Tulos)) # 140 results has type L0.05, T0.1 or similar and are turned into NA.
Hg$Tulos <- ifelse(Hg$Yksikkö=="µg/kg", Hg$Tulos * 0.001, Hg$Tulos)
Hg$Yksikkö[Hg$Yksikkö=="µg/kg"] <- "mg/kg"
oprint(summary(Hg))
oprint(aggregate(Hg$Tulos, by = Hg[c("Helcom-alue")], FUN=length))
oprint(aggregate(Hg$Tulos, by = Hg[c("Näytelaji")], FUN=length))
# summary(lm(Tulos ~ `Helcom-alue` + Näytelaji, data = Hg))
# The different species (Näytelaji) vary generally more than +-0.35 mg/kg, while
# the different Helcom areas vary less than +-0.19
# Because we are mainly interested in Porvoo vs other Finland, we will categorise is accordingly.
Hg$Area <- ifelse(Hg$`Helcom-alue`=="F-Suomenlahti", "Gulf of Finland","Finland")
Hg <- Hg[!is.na(Hg$Tulos),]
Hg$Tulos[Hg$Tulos==0] <- 0.002 # Approximate level of detection
Hg <- rbind(
data.frame(
Parameter = "Mean",
aggregate(Hg$Tulos, by = Hg[c("Area", "Näytelaji")], FUN=mean)
),
data.frame(
Parameter = "SD",
aggregate(Hg$Tulos, by = Hg[c("Area", "Näytelaji")], FUN=sd)
),
data.frame(
Parameter = "MeanLog",
aggregate(log10(Hg$Tulos), by = Hg[c("Area", "Näytelaji")], FUN=mean)
),
data.frame(
Parameter = "SDLog",
aggregate(log10(Hg$Tulos), by = Hg[c("Area", "Näytelaji")], FUN=sd)
),
data.frame(
Parameter = "N",
aggregate(Hg$Tulos, by = Hg[c("Area", "Näytelaji")], FUN=length)
)
)
Hg$Compound <- "Mercury (µg/g)"
Hg <- reshape(Hg, idvar = c("Area","Näytelaji","Compound"), timevar = "Parameter", v.names = "x", direction = "wide")
colnames(Hg)[colnames(Hg)=="Näytelaji"] <- "Kala"
colnames(Hg) <- gsub("x\\.", "", colnames(Hg))
oprint(Hg)
objects.store(Hg)
cat("Data.frame Hg stored.\n")
| |
See also
References