Skip to content

Replace hard-coded iris column vectors with names() calls#13

Merged
yihui-bot merged 2 commits intomainfrom
copilot/replace-hard-coded-variable-names
Mar 31, 2026
Merged

Replace hard-coded iris column vectors with names() calls#13
yihui-bot merged 2 commits intomainfrom
copilot/replace-hard-coded-variable-names

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Long hard-coded column name vectors like c('Sepal.Length', 'Sepal.Width', 'Petal.Length', 'Petal.Width') are verbose and brittle. Replace with names(iris)[-5] in the parallel coordinate examples.

Changes

  • R/coordinate.R — roxygen example for coord_() parallel coordinate
  • examples/coordinates.Rmd — live parallel coordinate code chunk
# Before
g2(iris, position = c('Sepal.Length', 'Sepal.Width',
    'Petal.Length', 'Petal.Width'), color = 'Species', ...)

# After
g2(iris, position = names(iris)[-5], color = 'Species', ...)

@yihui-bot yihui-bot marked this pull request as ready for review March 31, 2026 18:37
@yihui-bot yihui-bot merged commit 36c35b7 into main Mar 31, 2026
5 checks passed
@yihui-bot yihui-bot deleted the copilot/replace-hard-coded-variable-names branch March 31, 2026 18:37
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