One of the reasons why R functions so well as a specialized mathematics-focused language is due to its highly optimized R interpreter/JIT and runtime.
Similarly to MATLAB or Mathematica, or even utilizing numpy in conjunction with Python,
If one were to transpile R code into JS, the performance would likely fall short in comparison, especially when trying to execute complex computations typically handled by an R program (particularly if the R code involves intricate calculations).
There doesn't appear to be any existing project focused on compiling R to JS - suggesting it may not be a demanded feature.
The JavaScript-only ecosystem in Chrome extensions seems ill-suited for executing R code within.
If using Firefox or IE, it becomes possible to access DLLs from within extensions - leveraging COM on IE and the FF native bridge API. Unfortunately, Chrome lacks direct support for such capabilities.
An effective solution is developing an NPAPI plugin - introducing a bit of native code in the form of a DLL that can be interacted with through JS using an OBJECT tag. I have utilized this method to create an extension replacing Flash video controls with a windowless VLC player across Chrome, FF, and IE.
This approach proves to be the most efficient. Write your R code, convert it into a DLL, expose the interface via an NPAPI plugin. Then, inject an OBJECT tag into the HTML within your extension, which will instantiate your native code instance - allowing you to directly invoke methods as if interacting with a JS object.
An alternative solution could involve translating R to MATLAB, converting the MATLAB code into C++ (which is feasible), and subsequently running the C++ as native client code in the browser.