Skip to content

Conversation

@zzawadz
Copy link
Owner

@zzawadz zzawadz commented Jan 17, 2026

Add many new examples to the customLayout cookbook vignette:

Base Graphics (7 examples):

  • Simple multi-panel layout with lay_new and lay_set
  • Asymmetric layout with different panel sizes
  • Combining rows and columns with lay_bind_row/lay_bind_col
  • Statistical summary dashboard for model diagnostics
  • Time series with annotation panel and correlation matrix
  • Pairs plot alternative with custom layout
  • Publication-ready figure with outer margins and panel labels

ggplot2 Graphics (12 examples):

  • Basic ggplot2 multi-panel layout
  • Dashboard with header and different sized panels
  • Facet-like arrangement with independent scales
  • Inset plots showing zoomed regions
  • Combining different plot types (scatter, bar, density)
  • Multiple legends arrangement with cowplot
  • Heatmap with marginal summaries
  • Model comparison plot (linear vs quadratic)
  • Multi-dataset comparison
  • Creating a themed report layout
  • Annotated plot arrangement
  • Complex nested layout with lay_bind operations

Add many new examples to the customLayout cookbook vignette:

Base Graphics (7 examples):
- Simple multi-panel layout with lay_new and lay_set
- Asymmetric layout with different panel sizes
- Combining rows and columns with lay_bind_row/lay_bind_col
- Statistical summary dashboard for model diagnostics
- Time series with annotation panel and correlation matrix
- Pairs plot alternative with custom layout
- Publication-ready figure with outer margins and panel labels

ggplot2 Graphics (12 examples):
- Basic ggplot2 multi-panel layout
- Dashboard with header and different sized panels
- Facet-like arrangement with independent scales
- Inset plots showing zoomed regions
- Combining different plot types (scatter, bar, density)
- Multiple legends arrangement with cowplot
- Heatmap with marginal summaries
- Model comparison plot (linear vs quadratic)
- Multi-dataset comparison
- Creating a themed report layout
- Annotated plot arrangement
- Complex nested layout with lay_bind operations
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56e2000ffa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# Layout: top density, main scatter with right density, bar chart
lay <- lay_new(
matrix(c(1, 1, 0,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use NA (not 0) for empty cells in lay_grid layout

This layout matrix is used with lay_grid(), which delegates to gridExtra::grid.arrange. grid.arrange treats NA as the marker for empty cells; 0 is interpreted as a grob index, so rendering this example will try to access grob 0 and error (or misplace grobs), causing the vignette chunk to fail when built. This is fine for base layout(), but for grid graphics you should replace the 0 with NA (and keep the grob list aligned with indices 1..n).

Useful? React with 👍 / 👎.

# Layout
lay <- lay_new(
matrix(c(1, 2,
3, 0), ncol = 2, byrow = TRUE),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid 0 in grid layout_matrix; it breaks lay_grid

This example uses lay_grid() with a layout matrix that includes 0 as an “empty” slot. gridExtra::grid.arrange expects NA for blank cells; 0 is treated as an index, so this chunk will attempt to place grob 0 (and fail), especially during vignette builds. Use NA for the empty cell and drop the placeholder NULL grob so the list indices match only the numbered cells.

Useful? React with 👍 / 👎.

@zzawadz
Copy link
Owner Author

zzawadz commented Jan 17, 2026

✅ R CMD check: Check passed

Commit: 56e2000f
R version: R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"

Result Count
Errors 0
Warnings 0
Notes 0

Duration: 2m 36s

Click to expand full R CMD check output
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> 
> library(rcmdcheck)
> options(crayon.enabled = FALSE)
> 
> result <- rcmdcheck(
+     path = '.',
+     args = strsplit('--as-cran', ' ')[[1]],
+     build_args = c('--no-manual'),
+     error_on = 'never',
+     check_dir = '/pkg/check'
+ )
── R CMD build ─────────────────────────────────────────────────────────────────
* checking for file ‘.../DESCRIPTION’ ... OK
* preparing ‘customLayout’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR
--- re-building ‘comparison-with-other-packages.Rmd’ using rmarkdown
--- finished re-building ‘comparison-with-other-packages.Rmd’
--- re-building ‘customlayout-cookbook.Rmd’ using rmarkdown
Quitting from customlayout-cookbook.Rmd:836-893 [unnamed-chunk-16]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `library()`:
! there is no package called 'reshape2'
---
Backtrace:
    ▆
 1. └─base::library(reshape2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'customlayout-cookbook.Rmd' failed with diagnostics:
there is no package called 'reshape2'
--- failed re-building ‘customlayout-cookbook.Rmd’
--- re-building ‘layouts-for-officer-power-point-document.Rmd’ using rmarkdown
Warning: The vignette title specified in \VignetteIndexEntry{} is different from the title in the YAML metadata. The former is "Layouts for officer's PowerPoint documents", and the latter is "Layouts for officer's PowerPoint documents.". If that is intentional, you may set options(rmarkdown.html_vignette.check_title = FALSE) to suppress this check.
--- finished re-building ‘layouts-for-officer-power-point-document.Rmd’
--- re-building ‘Roadmap.Rmd’ using rmarkdown
--- finished re-building ‘Roadmap.Rmd’
SUMMARY: processing the following file failed:
  ‘customlayout-cookbook.Rmd’
Error: Vignette re-building failed.
Execution halted
Error in proc$get_built_file() : Build process failed
Calls: rcmdcheck ... build_package -> with_envvar -> force -> <Anonymous>
Execution halted

Powered by R Check Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants