We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Users have reported that an error is encountered in gentlg when creating the output for multiple graphs. The reprex is below.
library(dplyr) library(ggplot2) library(tidytlg)
adsl <- cdisc_adsl %>% filter(SAFFL == "Y")
tblid <- "test2plots"
plot1 <- ggplot(data = adsl, aes(x = HEIGHTBL, y = WEIGHTBL)) + geom_point() + labs(x = "Baseline Height (cm)", y = "Baseline Weight (kg)")
png("../output/plot1.png", width=2800, height=1800, res=300, type = "cairo")
plot1
dev.off()
plot2 <- ggplot(data = adsl, aes(x = WEIGHTBL, y = HEIGHTBL)) + geom_point() + labs(x = "Baseline Weight (kg)", y = "Baseline Height (cm)")
png("../output/plot2.png", width=2800, height=1800, res=300, type = "cairo")
plot2
gentlg(tlf = "g", plotnames = paste0("../output/", c("plot1.png","plot2.png")), opath = "../output", plotwidth = 8, plotheight = 5, orientation = "landscape", file = tblid, title = "Scatter plot")
Error in if (file.exists(plotnames)) { : the condition has length > 1
This used to work in previous version without error.
The text was updated successfully, but these errors were encountered:
Add in multiple file suppport, #13
4c08f42
Merge pull request #15 from pharmaverse/13-multiple-gentlg-graphs
815bc8d
Add in multiple file support, #13
elimillera
No branches or pull requests
Users have reported that an error is encountered in gentlg when creating the output for multiple graphs. The reprex is below.
Prep Environment
library(dplyr)
library(ggplot2)
library(tidytlg)
adsl <- cdisc_adsl %>%
filter(SAFFL == "Y")
tblid <- "test2plots"
Generate Results
plot1 <- ggplot(data = adsl, aes(x = HEIGHTBL, y = WEIGHTBL)) +
geom_point() +
labs(x = "Baseline Height (cm)",
y = "Baseline Weight (kg)")
create png file of plot1
png("../output/plot1.png", width=2800, height=1800, res=300, type = "cairo")
plot1
dev.off()
plot2 <- ggplot(data = adsl, aes(x = WEIGHTBL, y = HEIGHTBL)) +
geom_point() +
labs(x = "Baseline Weight (kg)",
y = "Baseline Height (cm)")
create png file of plot2
png("../output/plot2.png", width=2800, height=1800, res=300, type = "cairo")
plot2
dev.off()
Output Results
gentlg(tlf = "g",
plotnames = paste0("../output/", c("plot1.png","plot2.png")),
opath = "../output",
plotwidth = 8,
plotheight = 5,
orientation = "landscape",
file = tblid,
title = "Scatter plot")
Error in if (file.exists(plotnames)) { : the condition has length > 1
This used to work in previous version without error.
The text was updated successfully, but these errors were encountered: