Skip to content
New issue

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

Save plot images in different formats with opts_chunks$dev #1507

Merged
merged 4 commits into from
Jan 29, 2024

Conversation

Rumengol
Copy link

The knitr documentation indicates that it is possible to pass a vector of target devices to save the same plot in different formats. Reticulate uses dir.create() to create the destination directory if it doesn't exist, however this function can only accept one path and will fail with multiple target devices, as knitr::fig_path() will return a vector of 2 paths.

This PR solves the issue by considering the return type of knitr::fig_path() as a vector of strings rather than a single string and calling lapply on functions that relies on a single element.

@t-kalinowski t-kalinowski merged commit 3b73b59 into rstudio:main Jan 29, 2024
12 checks passed
@t-kalinowski
Copy link
Member

Thank you very much!

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.

2 participants