Skip to content

Commit

Permalink
Add a few more snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
coatless committed May 1, 2024
1 parent 7d6a760 commit 7e55b8d
Show file tree
Hide file tree
Showing 5 changed files with 1,830 additions and 0 deletions.
16 changes: 16 additions & 0 deletions snippets/demo-webr-dev-console.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var webRready = await import('https://webr.r-wasm.org/latest/webr.mjs').then(
async ({ WebR }) => {
const webR = new WebR();
await webR.init();
return webR;
}
);

webRready.version
webRready.evalR('set.seed(1); rnorm(10,5,1)');

let result = await webRready.evalR('set.seed(1); rnorm(10,5,1)');
result

let output = await result.toArray();
output
7 changes: 7 additions & 0 deletions snippets/hello_world.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdio.h>

int main() {
printf("Hello, world!\n");

return 0;
}
Loading

0 comments on commit 7e55b8d

Please sign in to comment.