Find a better solution for generating code in `vetiver_write_plumber()`
Opened this issue · 0 comments
juliasilge commented
As of right now, we use this approach to generating the code to read a board in vetiver_write_plumber()
:
Lines 66 to 72 in 1a5308f
Problems around this have come up multiple times, in #253, #256, and #239, but we still are not in a good place. @EmilHvitfeldt reported yet another problem, when the code needed for board_*()
is so long that the width
option makes it break across lines.
What is a good way to solve this once and for all?
- Is there something like
deparse()
orrlang::expr_deparse()
that lets us never print across multiple lines? - Just set
width
to something really big? - Can we get the numbers of characters from
pins::board_deparse(board)
and then set the width inrlang::expr_deparse()
? (Note, it's not a character.) Likesum(nchar(as.character(board_deparse(board))))
and then add in another couple dozen characters to account for how the call is structured?