plotfactortrajectories: Plot factor trajectories

View source: R/plottingfunctions.R

plotfactortrajectoriesR Documentation

Plot factor trajectories

Description

plotfactortrajectories plots the averaged output of the factors used to generate simulated trial data

Usage

plotfactortrajectories(data, tinfo, tds, opt2plot, mergeacrossreps = TRUE)

Arguments

data

the $rawdata$precensor component of the output of generateSimulatedResults (run with rawdataout=TRUE)

tinfo

the $results component of the output of generateSimulatedResults

tds

the $parameterselections$trialdesigns component of the output of generateSimulatedResults

opt2plot

a data.table with a single row using parameter names to instruct the function which parameters to hold constant and plot the results of

mergeacrossreps=TRUE

logical input of whether to merge across repititions

Value

a ggplot object containing the plot

Examples

  data(results_trajectories)
  data<-simresults$rawdata$precensor # this gives a list of length (total reps done)
  tinfo<-simresults$results # dim[1] of tinfo gives the parameter space that went in
  tds<-simresults$parameterselections$trialdesigns
  mergeacrossreps<-TRUE
  plots1<-vector(mode="list",length=length(simresults$parameterselections$trialdesigns))
  for(ip in 1:length(plots1)){
    param2hold<-data.table(carryover_t1half=0,trialdesign=ip)
    plots1[[ip]]<-plotfactortrajectories(data,tinfo,tds,param2hold,mergeacrossreps)
  }
  # See vignettes for additional details

rchendrickson/pmsimstats documentation built on Nov. 28, 2024, 11:05 a.m.