Chapter 15 R markdown
This chapter covers R markdown-specific functions of the twinetverse.
We’ve actually covered a few of those already, rtweet and graphTweets do not have functions specifically meant to be used in R markdown, all work just as well in a interactive and non-interactive environments. The dynamic nature of sigmajs, however, suggests the intriduction of additional functions.
some functions of the sigmajs package take a
delay argument, which, though can be used in any way or framework (shiny, R markdown, etc.), it is specifically designed with R markdown in mind. Take for instance the layout algorithm and button we used above; as you read this it is still running, which is draining for the browser and useless as the layout has stabilised. We could do the inverse of what we do above, of course, trigger the layout on page load and instead provide a button for the user to stop the layout. However, what would be ideal is for the layout to simply stop after a few seconds. Let’s implement the latter.
We removed the button as we just trigger the layout algorithm when the page loads then we pass
sg_force_stop specifying that we want the force layout to stop after 10,000 milliseconds (10 seconds).