Summary

In this chapter, we have used a lot of different JavaScript libraries and R packages and have produced a diverse range of plots, many of which you will find useful in your own applications. It's universally true that the actual plotting instructions themselves are very simple (although you can highly customize the output with different arguments) as long as your data is in the right format. It's worth taking the time to understand the types of inputs the packages accept, and if you don't get the results, you want a good place to start fixing the problem by looking at the structure of the input (run str(theInput) to have R show you the structure of an input). Another potential source of problems is to ensure that Shiny passes arguments to your functions in the correct way. Keep in mind that they will often be strings that will not always function in the same way as in standard R plotting instructions (for example, in the rCharts example, when using a formula-based plotting instruction). The debugging advice in Chapter 4, Taking Control of Reactivity, Inputs, and Outputs, will prove to be useful here, particularly, when using cat(input$problemInput) or cat(str(input$problemInput)) to examine the content and structure of the variables, which Shiny passes to your plotting functions.

There are more packages using htmlwidgets and more plots that are available than the ones we looked at here. So, once you have explored the material in this chapter, read the documentation, go to http://www.htmlwidgets.org/, see what's out there, and have some fun incorporating it into your own applications.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.138.31