set.seed(100);
pgs.data <- data.frame(
PGS = rnorm(100, 0, 1)
);
temp.dir <- tempdir();
# Basic Plot
create.pgs.boxplot(
pgs.data,
output.dir = temp.dir,
filename.prefix = 'basic-plot',
width = 6,
height = 6
);
# Plot multiple PGS outputs
pgs.data$PGS.with.normalized.missing <- rnorm(100, 1, 1);
create.pgs.boxplot(pgs.data, output.dir = temp.dir);
# Plot non-default PGS columns
pgs.data$PGS.custom <- rnorm(100, 2, 1);
create.pgs.boxplot(pgs.data, pgs.columns = 'PGS.custom', output.dir = temp.dir);
# Plot phenotype categories
pgs.data$sex <- sample(c('male', 'female'), 100, replace = TRUE);
# \donttest{
create.pgs.boxplot(
pgs.data,
output.dir = temp.dir,
filename.prefix = 'multiple-pgs',
phenotype.columns = 'sex'
);
# }
# Plot multiple phenotypes
pgs.data$letters <- sample(letters[1:5], 100, replace = TRUE);
# \donttest{
create.pgs.boxplot(
pgs.data,
output.dir = temp.dir,
filename.prefix = 'multiple-phenotypes',
phenotype.columns = c('sex', 'letters')
);
# }
Run the code above in your browser using DataLab