Skip to content

high resolution tiff of op plots #234

Answered by mhovd
ChrisKonig asked this question in Q&A
Discussion options

You must be logged in to vote

Here is a small example to show you how you can generate a plot manually using the data contained in the op-object of the PMresult. This example uses ggplot2 to create the figure, and saves it using ggsave.

library(Pmetrics)
library(tidyverse)
library(ggpubr)

# Replace this with your OP-object from your result
op <- NPex$op$data

# Create the plot using `ggplot2`
op_plot = op %>% 
  filter(pred.type == "post") %>% # Filter for posterior predictions
  filter(icen == "mean") %>% # Filter to use the mean of the posterior parameters, as opposed to the median
  ggplot(aes(x = pred, y = obs)) +
  geom_abline(slope = 1, intercept = 0, lty = "dashed", alpha = 0.5) + # Add a reference line
  geom…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mhovd
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants