官术网_书友最值得收藏!

The program structure

Since the first edition of this book, a significant change has taken place with regards to how Shiny applications are structured. A new feature has been added, giving us the ability to place them all within one code file. This is most useful when building small demonstrations or examples for other users, who can just paste the whole code file into the console and have the application run automatically. In order to make use of this functionality, just combine the code from server.R and ui.R, as shown in the following example:

library(shiny) 
server <- function(input, output) { 
  #contents of server.R file 
} 
 
ui <- fluidPage( # or other layout function 
  # contents of ui.R file 
) 
shinyApp(ui = ui, server = server) 

This is useful neither for large applications, nor for the purposes of explaining the functions of particular parts of code within this book, so we shall ignore it from now on. Just be aware that it's possible; you may well come across it on forums, and you may wish to contribute some small examples yourself.

主站蜘蛛池模板: 竹北市| 沙洋县| 湘阴县| 广南县| 渝北区| 梧州市| 琼结县| 广丰县| 芜湖市| 芦溪县| 湖南省| 阜阳市| 镇安县| 汾阳市| 土默特左旗| 保亭| 司法| 大冶市| 盐津县| 香港 | 方山县| 衡南县| 辽宁省| 于都县| 河南省| 化德县| 岳阳市| 乳源| 梁山县| 河津市| 洪湖市| 会泽县| 镇沅| 宁安市| 临夏县| 长宁县| 新和县| 田阳县| 沐川县| 扶风县| 陕西省|