Public
Edited
Jul 1, 2024
1 star
Insert cell
Insert cell
Insert cell
html`${await webR.evalRString`
gt::gt(mtcars) |>
gt::as_raw_html(
inline_css = FALSE # required for {gt} in WebR
)`}`
Insert cell
webR = {
const { WebR, ChannelType } = await import(
"https://webr.r-wasm.org/latest/webr.mjs"
);

const intWebR = new WebR({
channelType: ChannelType.PostMessage,
interactive: false
});

await intWebR.init();

// Things seem to work better if you load the pkgs here

await intWebR.installPackages(["gt"], true);

await intWebR.evalRVoid(`
library(gt)
`);

document.querySelector("#loader").innerText = "🟢";
document.querySelector("#msg").innerText = "WebR loaded!";

return intWebR;
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more