Writing javascript in RStudio IDE

Do programmers who write lots of R and javascript do all their work in RStudio or use another editor for writing javascript?

Does the RStudio IDE provides code checking and code completion for javascript?

Thanks!

2 Likes

I'm not aware of support for Javascript in RStudio IDE. The htmlwidgets package is often used as a toolset for creating Javascript bindings in R. leaflet and DataTables are good examples of packages built on htmlwidgets for this purpose. You can listen to a presentation on that topic here: https://www.rstudio.com/resources/webinars/creating-javascript-data-visualizations-in-r/

1 Like

I think it would be great if the IDE at least supported a JavaScript file type in the new file menu. JavaScript is so common for any web protocol effort it is a bit short sighted to omit it.

1 Like

It's worth saying that RStudio does come with a JavaScript editor mode, with basic syntax highlighting and indentation. While we don't have UI for explicitly creating JavaScript files yet (since the main users of JavaScript will be advanced Shiny users and so it's still relatively uncommon for R users to want / need to edit JavaScript) you can still create and edit such a file explicitly with e.g. file.edit("path/to/file.js"). (Make sure the parent directory for the file you want to edit exists first)

2 Likes