Skip to main content
. 2021 Jun 1;7:e544. doi: 10.7717/peerj-cs.544

Figure 1. Workflow of the R2VR package.

Figure 1

A function package is used to start a Fiery server from the R console and render WebXR Device API scenes via harnessing Mozilla’s A-Frame framework. This allows for the scene to be composed through the R interface and served into HTML and JavaScript which displays the VR scene in a WebXR environment (web browser and/or VR headset). There is a WebSocket connection between the Fiery server and the client which allows for R console commands to directly communicate with the user (e.g., display a question with the pop() function) in the VR environment. The recorded data is stored in an online MySQL database through a RESTful MVC NodeJS Application Programming Interface (APIRest). The Node API endpoints are made accessible for data fetching into R so all user responses can be analysed. There is an interoperable flow of data between R and VR through the implementation of the WebSocket and an API connections.