fix(decode): only produce an image object for each unique plot
nokome opened this issue ยท 1 comments
nokome commented
The evaluate
function (from the R package evaluate
) produces an output for each statement e.g.
lapply(evaluate('plot(1); abline(0,1)'), class)
[[1]]
[1] "source"
[[2]]
[1] "recordedplot"
[[3]]
[1] "recordedplot"
The rasta::decode
function converts each output into a document node - in the above example, it will produce two ImageObjects
, one for each recordedplot
in the list. This is not desirable. Instead, we need a way to only generate one image output for each actual plot.
A temporary workaround is to wrap as a block e.g.
> lapply(evaluate('{plot(1); abline(0,1)}'), class)
[[1]]
[1] "source"
[[2]]
[1] "recordedplot"
stencila-ci commented
๐ This issue has been resolved in version 0.8.1 ๐
The release is available on GitHub release
Your semantic-release bot ๐ฆ๐