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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more