SubgrPlots (version 0.1.0)

plot_circle2: Circular plot using circlize package with matrix layout.

Description

This function produces a circular plot for subgroup analysis

Usage

plot_circle2(dat, covari.sel, trt.sel, resp.sel, outcome.type, range.v = NULL,
  adj.ann.subgrp = 4, range.strip = c(-3, 3), n.brk = 31,
  n.brk.axis = NULL, font.size = c(1, 1, 0.85, 0.85, 1), title = NULL,
  lab.xy = NULL, strip = "Treatment effect size", effect = "HR",
  equal.width = TRUE, show.KM = FALSE, show.effect = TRUE,
  conf.int = TRUE, palette = "divergent", col.power = 0.5, nrow = 2,
  ncol = 4)

Arguments

dat

a data set

covari.sel

a vector of indices of the two covariates

trt.sel

a covariate index specifying the treatment code

resp.sel

a covariate index specifying the response variable

outcome.type

a string specifying the type of the response variable, it can be "continuous", or "binary" or "survival".

range.v

a vector specifying the vertical range of graphical display.

adj.ann.subgrp

a parameter adjusting the distance between a point and its corresponding subgroup label. The smaller the value is, the larger the distance is.

range.strip

a vector with two elements specifying the range of treatment effect size for display

n.brk

a number specifying the number of the points dividing the range of the argument "range.strip".

n.brk.axis

a number specifying the number of breakpoints dividing the axis of the argument "range.strip".

font.size

a vector specifying the size of labels and text; the first element is for the main title, the second is for for x-axis and y-axis labels; the thrid is for the legend text of subgroups; the fourth is for the subgroup labels near points; the fifth is for the unit labels on all the axes.

title

a string specifying the main title.

lab.xy

a list of two strings specifying the labels of the x and y axes.

strip

a string specifying the title of the colour strip.

effect

either "HR" or "RMST". only when outcome.type = "survival"

equal.width

A logical indicating whether the sectors should have equal width or proportional to their sample sizes

show.KM

A logical indicating whether to show the Kaplan-Meier curves for the subgroups

show.effect

A logical indicating whether to show the treatment effect

conf.int

A logical indicating whether to show confidence intervals for the treatment effect.

palette

either "divergent" or "hcl"

col.power

to be used when palette = "hcl". see colorspace package for reference

nrow

Number of rows in the matrix layout

ncol

Number of columns in the matrix layout

Examples

Run this code
# NOT RUN {
# Load the data to be used
data(prca)
dat <- prca
set.seed(12)
plot_circle2(dat,
                   covari.sel = c(4, 5, 6, 7),
                   trt.sel = 3,
                   resp.sel = c(1,2),
                   outcome.type = "survival",
                   range.v = NULL,
                   adj.ann.subgrp = 4,
                   range.strip=c(-3, 3),
                   n.brk = 31,
                   n.brk.axis = 7,
                   font.size = c(1, 1, 0.85, 0.85, 1),
                   title = NULL, lab.xy = NULL,
                   strip = "Treatment effect size (log hazard ratio)",
                   effect = "HR",
                   equal.width = FALSE,
                   show.KM = FALSE,
                   show.effect = TRUE,
                   conf.int = FALSE, palette = "hcl")


# }

Run the code above in your browser using DataCamp Workspace