Skip to contents

Prepare visualization results for Cadenza

Usage

as_cadenza_visualization(res, plotfile)

Arguments

res

The Plumber response construct

plotfile

The plot file created in the Plumber R file

Value

The Plumber response construct with the plot data added

Examples

png(file = "plot.png")
plot(list(1), list(1))
dev.off()
#> agg_png 
#>       2 
res <- list("injected from plumber")
res <- as_cadenza_visualization(res, "plot.png")
res$status
#> [1] 200
res$headers
#> $`Content-Encoding`
#> [1] "multipart/form-data"
#> 
#> $`Content-Type`
#> multipart/form-data; boundary=xD5Gp7zpqV1vhwab9EsI2EiQ9YgFTI; charset=UTF-8
#> 
length(res$body)
#> [1] 4535