test20180904
code:test.R
library(RColorBrewer)
fileEncoding="CP932")
data$time = as.POSIXct(paste(data$試料採取日, data$試料採取時))
tmin = min(data$time)
tmax = max(data$time)
nuclides = c("H.3.トリチウム.", "Sr.90", "I.129", "Ru.106", "Tc.99")
排水告示濃度 = c(6.0e1, 3.0e-2, 9.0e-3, 1.0e-1, 1.0e0) # Bq/cm^3
names(排水告示濃度) = nuclides
N = length(nuclides)
cols = brewer.pal(N, "Dark2")
pchs = 0:(N-1)
par(mgp=c(2,0.8,0)) # 軸マージン(デフォルト: c(3,1,0))
plot(NULL, xlab="", ylab="告示濃度比 (-)", xlim=c(tmin,tmax), ylim=c(0.001,1000),
log="y", xaxt="n")
axis.POSIXct(1, at=seq(tmin,tmax,by="1 months"), format="%Y/%m")
for (i in -3:2) abline(h=(10^i)*(1:9), col="lightgray")
abline(h=1, lty=1, col="black")
legend("topleft", legend = nuclides, col = cols, pch=pchs, ncol=3, bg="white")
title(main=data$試料採取場所大項目1, sub=data$分析計画名称1) for (i in 1:N) {
points(data$time, Bqcc/排水告示濃度nuc, pch=pchsi, col=colsi) }
code:test2.R
fileEncoding="CP932", as.is=TRUE)
time = as.POSIXct(paste(data$試料採取日,data$試料採取時))
name = "I.129"
# name = "Cs.137"
value = datapaste0(name, "_結果")
nd = substr(value, 1, 1) == "<"
value = ifelse(nd, substr(value,2,1000), value)
value = as.numeric(value)
unit = datapaste0(name, "_単位")
value = ifelse(unit == "Bq/cm3", value * 1000, value)
yrange = range(c(0,value), na.rm=TRUE)
par(mgp=c(2,0.8,0))
plot(time, value, type="n", ylim=yrange, xlab="", ylab="", xaxt="n")
axis.POSIXct(1, time, format="%Y/%m/%d")
if (name == "I.129") abline(h=9, col="orange")
abline(h=mean(value,na.rm=TRUE), col="gray")
abline(h=mean(ifelse(nd,0,value),na.rm=TRUE), col="gray")
points(time, value, pch=ifelse(nd,1,16))
segments(time, ifelse(nd,value,NA), time, 0)
title(paste(name, "(Bq/L)"))