Package 'Certara.VPCResults'

Title: Generate Visual Predictive Checks (VPC) Using 'shiny'
Description: Utilize the 'shiny' interface to parameterize a Visual Predictive Check (VPC), including selecting from different binning or binless methods and performing stratification, censoring, and prediction correction. Generate the underlying 'tidyvpc' and 'ggplot2' code directly from the user interface and download R or Rmd scripts to reproduce the VPCs in R.
Authors: James Craig [aut, cre], Mike Talley [aut], Certara USA, Inc [cph, fnd]
Maintainer: James Craig <[email protected]>
License: LGPL-3
Version: 3.0.1
Built: 2024-11-10 06:01:50 UTC
Source: https://github.com/cran/Certara.VPCResults

Help Index


A ggplot2 theme for Certara.

Description

A ggplot2 theme for Certara.

Usage

theme_certara(
  base_size = 11,
  base_family = "",
  base_line_size = base_size/22,
  base_rect_size = base_size/22,
  grid = c("none", "horizontal", "both")
)

Arguments

base_size

base font size, given in pts.

base_family

base font family

base_line_size

base size for line elements

base_rect_size

base size for rect elements

grid

Which grid lines should appear? Horizontal only, both horizontal and vertical, or none (default). continuous_scale().

Details

There are 3 variants of the theme: no grid theme_certara(), full grid theme_certara(grid = "both"), and horizontal grid lines only theme_certara(grid = "horizontal").

Value

An object of class theme().


Shiny GUI to parameterize Visual Predictive Check (VPC)

Description

Use tidyvpc package to parameterize VPC from Shiny GUI and customize plot using ggplot2. Code generation functionality allows you to reproduce tidyvpc object and ggplot2 plot in your local R session via R script saved to your working directory.

Usage

vpcResultsUI(
  observed,
  simulated,
  ObsName = NULL,
  vpc.type = c("continuous", "categorical"),
  tagged = NULL,
  settings = NULL,
  ...
)

Arguments

observed

Observed input data.

simulated

Simulated input data.

ObsName

Optional character value specifiying the name of the observed dependent variable (e.g., ObsName).

vpc.type

Character value specifying type of VPC.

tagged

A list of tagged VPC's or model diagnostics created from previous Certara.VPC or Certara.ModelResults session.

settings

A list of plot customization settings used in previous Certara.VPC or Certara.ModelResults session.

...

Arguments for initiation from Pirana.

Value

If interactive(), returns a list of tagged diagnostics from the Shiny application, otherwise returns TRUE.

Examples

if (interactive()) {
vpcResultsUI(tidyvpc::obs_data, tidyvpc::sim_data)
}

Write code to R script from tagged diagnostics

Description

Use this function to write code to R script from diagnostics tagged in Certara's VPC Results Shiny Application.

Usage

write_code(tagged, file)

Arguments

tagged

List of tagged objects from returned from VPCResultsUI().

file

Character specifying path of output file. If missing, it will be saved as code.R in working directory.

Value

Returns NULL after writing to file.

Examples

if (interactive()) {
 tagged_diagnostics <-
   vpcResultsUI(tidyvpc::obs_data, tidyvpc::sim_data)

 write_code(tagged_diagnostics, "tagged_vpc.R")
}