Within R, we load the 'DOM' package. Then we use the htmlPage() function to create a web socket connection between R and the browser.