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

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.

主站蜘蛛池模板: 南汇区| 申扎县| 穆棱市| 海兴县| 张家港市| 江孜县| 涞源县| 历史| 门源| 县级市| 阜平县| 甘肃省| 昌吉市| 喀什市| 静宁县| 眉山市| 宁夏| 竹山县| 保靖县| 迭部县| 永德县| 茂名市| 洛浦县| 宽城| 江川县| 扎赉特旗| 永德县| 祁连县| 华阴市| 五原县| 元阳县| 涞水县| 滨州市| 温州市| 安泽县| 砀山县| 金湖县| 错那县| 阿拉善盟| 长葛市| 大城县|