INNER CODE UNIT · JavaScript
browse_data
moderndive/ModernDive_book · _extensions/webr/qwebr-compute-engine.js:92
const browse_data = await mainWebR.FS.readFile(path).then((data) => {
// Obtain the file content
let content = new TextDecoder().decode(data);
return content;
});
// Return extracted data as-is
return browse_data;
};
// Function to run the code using webR and parse the output
globalThis.qwebrComputeEngine = async function(
codeToRun,
elements,
options) {
// Call into the R compute engine that persists within the document scope.