Description Usage Arguments Value See Also Examples
View source: R/jointmetaplotall.R
This function is designed to take the output from jointmetaplot
and output the study plots of each type arranged into a grid.
1 2 |
plotlist |
the output from running the |
ncol |
the number of columns of the grid to arrange the plots in. This must be supplied to the function |
nrow |
the number of rows of the grid to arrange the plot in. This is
an optional parameter, which if not supplied is calculated in the function
based on the number of supplied plots and the specified value of
|
top |
a character string to act as the title for the plots |
type |
option to select what type of plots should be returned. If just
the grid of the longitudinal trajectories are required then |
An object of class 'jointplotsall'
is returned. If in the
function call type = 'Longitudinal'
or type = 'Both'
then the
element in the returned object names 'longall'
is the arranged grid
of longitudinal trajectory plots from each study in the dataset. If
type = 'Survival'
or type = 'Both'
then the element in the
returned object labelled 'eventsall'
is the arranged grid of the
survival probability plots from each study in the dataset. The arranged
grids can either be printed by name, or by extracting them as you would an
element from a list.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
#change data to jointdata format
jointdat<-tojointdata(longitudinal = simdat$longitudinal,
survival = simdat$survival, id = 'id',
longoutcome = 'Y', timevarying = c('time','ltime'),
survtime = 'survtime', cens = 'cens',
time = 'time')
#ensure variables are correctly formatted
jointdat$baseline$study <- as.factor(jointdat$baseline$study)
jointdat$baseline$treat <- as.factor(jointdat$baseline$treat)
#produce plots
#note that inclusion of a smoother sometime results in error messages
#see ggplot2 for error message interpretation
sepplots<-jointmetaplot(dataset = jointdat, study = 'study',
longoutcome = 'Y', longtime = 'time',
survtime = 'survtime', cens = 'cens', id = 'id',
smoother = TRUE, studynames = c('Study 1', 'Study 2',
'Study 3', 'Study 4', 'Study 5'), type = 'Both')
allplot2<-jointmetaplotall(plotlist = sepplots, ncol =2,
top = 'All studies', type = 'Both')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.