I have created a simple interactive Quarto Observable document that reads data from a CSV file, performs transformations, and generates a plot. The document works perfectly on my local environment. However, when I attempt to publish it on Rpubs using R Studio, I encounter an issue.
Here is the relevant code snippet from my Quarto Observable document where I read the CSV file:
LT = FileAttachment("LongTableBar.csv").csv().then(data => {
// Convert Percentage values to numbers
data.forEach(d => {
d.Percentage = parseFloat(d.Percentage);
});
// Now you can use the processed data
return data;
})
I make additional transformations and generate a plot in the document:
Plot.plot({
color: {legend: true},
y: {
grid: true
},
x: { axis: null },
marks: [
Plot.ruleY([0]),
Plot.barY(further_test, {x: "ID", y: "Percentage", sort: {x: "y", reverse: true}, fill: (d) => colorScale(d.intersections)})
]
})
The document works flawlessly on my local setup, as shown in this screenshot:
However, when I attempt to publish it on Rpubs, I encounter the following issue:
You can access the published document with the error here.
Additionally, I have received the following warning during the publishing process:
WARNING] Deprecated: --self-contained. use --embed-resources --standalone
I suspect that the issue may be related to the YAML configuration. I attempted to address it by modifying the YAML as follows:
title: "Test with some data"
format:
html:
page-layout: custom
execute:
echo: false
Rendering:
embed-resources: true
standalone: true
However, the error persists even after making this change. The entire document and associated files are available in this GitHub repository.
I have verified my Quarto version using the following code:
quarto::quarto_version()
[1] ‘1.2.335’
I appreciate any assistance in identifying and resolving the issue with publishing my Quarto Observable document on Rpubs. Thank you!
I am not sure why you are using the embed-resources
key under the execute
and then Rendering
key, but that's the reason embed-resources: true
is not generating a standalone file. Instead try using embed-resources
directly.
---
title: "Test with some data"
format:
html:
page-layout: custom
execute:
echo: false
embed-resources: true
standalone: true
---
And look into this issue #7331 on pandoc for details regarding the warning.