Skip to content

Commit

Permalink
Give error message if only row or col is added in theme
Browse files Browse the repository at this point in the history
Give error message in R session if only row or col is added in theme function.
  • Loading branch information
siddhesh195 committed Jul 30, 2024
1 parent a692b3d commit 95cd30f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/z_animint.R
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,13 @@ animint2dir <- function(plot.list, out.dir = NULL,
if(is.ggplot(p)){
## If plot is correct, save to meta for further processing
parsed_info <- parsePlot(meta, p, list.name) # calls ggplot_build.
#print(parsed_info$plot.info)
#print(parsed_info$plot.info$title)
if (!is.null(parsed_info$plot.info$row) && is.null(parsed_info$plot.info$col)) {
stop("You forget to add col in ",parsed_info$plot.info$title)
}
if (!is.null(parsed_info$plot.info$col) && is.null(parsed_info$plot.info$row)) {
stop("You forget to add row in ",parsed_info$plot.info$title)
}
AllPlotsInfo[[list.name]] <- parsed_info$plot.info
ggplot.list[[list.name]]$ggplot <- parsed_info$ggplot
ggplot.list[[list.name]]$built <- parsed_info$built
Expand Down

0 comments on commit 95cd30f

Please sign in to comment.