## load example data and recalculate to Gray
data(ExampleData.DeValues, envir = environment())
ExampleData.DeValues <-
Second2Gray(values = ExampleData.DeValues, dose_rate = c(0.0438,0.0019))
## plot the example data straightforward
plot_AbanicoPlot(data = ExampleData.DeValues)
## now with linear z-scale
plot_AbanicoPlot(data = ExampleData.DeValues,
log.z = FALSE)
## now with output of the plot parameters
plot1 <- plot_AbanicoPlot(data = ExampleData.DeValues,
output = TRUE)
str(plot1)
plot1$zlim
## now with adjusted z-scale limits
plot_AbanicoPlot(data = ExampleData.DeValues,
zlim = c(100, 200))
## now with adjusted x-scale limits
plot_AbanicoPlot(data = ExampleData.DeValues,
xlim = c(0, 60))
## now with user-defined plot ratio
plot_AbanicoPlot(data = ExampleData.DeValues,
plot.ratio = 0.5)
## now with user-defined central value
plot_AbanicoPlot(data = ExampleData.DeValues,
central.value = 120)
## now with weighted median as measure of centrality
plot_AbanicoPlot(data = ExampleData.DeValues,
centrality = "median.weighted")
## now with median/quartile range as measure of centrality/dispersion
plot_AbanicoPlot(data = ExampleData.DeValues,
centrality = "median",
dispersion = "qr")
## now with user-defined green line for MAM3 (i.e. 2936.3)
MAM <- calc_MinDose3(input.data = ExampleData.DeValues,
sigmab = 0.3,
gamma.xub = 7000,
output.plot = FALSE)
MAM <- as.numeric(get_RLum.Results(object = MAM,
data.object = "results")$mindose)
plot_AbanicoPlot(data = ExampleData.DeValues,
xlim = c(0, 50),
line = MAM,
line.col = "darkgreen",
line.label = "MAM3-dose")
## now add lines (e.g. De = 100) completely manually
## 1. infer extra data
extra <- plot_AbanicoPlot(data = ExampleData.DeValues,
output = TRUE)
## 2. transform De value to plot coordinates, only use log when
## log.z = TRUE. Don't mind the cryptic equation too much.
De <- 100
y.De <- (log(De) - extra$data.global$z.central[1]) * extra$polar.box[2]
## 3. create line coordinates (origin - polar margin - cartesian margin)
line.x <- c(0, extra$polar.box[2], extra$cartesian.box[2])
line.y <- c(0, y.De, y.De)
## 4. draw the line
lines(x = line.x, y = line.y, lwd = 2, lty = 4, col = "tomato")
## now create plot with legend, colour, different points and smaller scale
plot_AbanicoPlot(data = ExampleData.DeValues,
legend = "Sample 1",
col = "tomato4",
bar.col = "peachpuff",
pch = "R",
cex = 0.8)
## now without 2-sigma bar, polygon, grid lines and central value line
plot_AbanicoPlot(data = ExampleData.DeValues,
bar.col = "none",
polygon.col = "none",
grid.col = "none",
y.axis = FALSE,
lwd = 0)
## now with direct display of De errors, without 2-sigma bar
plot_AbanicoPlot(data = ExampleData.DeValues,
bar.col = "none",
ylab = "",
y.axis = FALSE,
error.bars = TRUE)
## now with user-defined axes labels
plot_AbanicoPlot(data = ExampleData.DeValues,
xlab = c("Data error [%]",
"Data precision"),
ylab = "Scatter",
zlab = "Equivalent dose [Gy]")
## now with minimum, maximum and median value indicated
plot_AbanicoPlot(data = ExampleData.DeValues,
central.value = 150,
stats = c("min", "max", "median"))
## now with a brief statistical summary
plot_AbanicoPlot(data = ExampleData.DeValues,
summary = c("n", "in.ci"))
## now with another statistical summary as subheader
plot_AbanicoPlot(data = ExampleData.DeValues,
summary = c("mean.weighted", "median"),
summary.pos = "sub")
## now the data set is split into sub-groups, one is manipulated
data.1 <- ExampleData.DeValues[1:15,]
data.2 <- ExampleData.DeValues[16:25,] * 1.3
## now a common dataset is created from the two subgroups
data.3 <- list(data.1, data.2)
## now the two data sets are plotted in one plot
plot_AbanicoPlot(data = data.3)
## now with some graphical modification
plot_AbanicoPlot(data = data.3,
col = c("steelblue4", "orange4"),
bar.col = c("steelblue3", "orange3"),
polygon.col = c("steelblue1", "orange1"),
pch = c(2, 6),
density = c(10, 20),
angle = c(30, 50),
summary = c("n", "in.ci"))
Run the code above in your browser using DataLab