Errata

Mastering Shiny

Errata for Mastering Shiny

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 13
Code block for exercise 5

In the printed version of the book (2021-04-29), the code sample for chapter 1 exercise 5 contains only two bugs, not three.

The source for the exercise on Github (https://github.com/hadley/mastering-shiny/blob/master/basic-app.Rmd) reads:

output$summmry <- renderPrint({
summary(dataset())
})

But in the printed version of the book, the misspelling has been corrected:

output$summary <- renderPrint({ # the misspelling has been corrected
summary(dataset())
})

Alex Stevens  Jun 29, 2021 
Printed Page 45,47
Figure at top of pg 45/Figure at bottom of pg 47

I think that the figures 3-10 and 3-13 are swapped.

David Rhoda  Jun 03, 2021 
Printed Page 145
Download example code

I have been implementing the code in the examples given in the chapters. for the most part, they give what is expected. in the case of the downloading data example, we have included code in the example:

output$download <- downloadHandler(
filename = function(){
paste0(input$dataset,".tsv")
},
content = function(file){
vroom::vroom_write(data(), file)
}
)

I've taken this to mean that at least one of:
1) "<dataset>.tsv" will appear in the "download file" dialog box
2)"<dataset>.tsv" will be the name of the file saved

<dataset> is the value of input$dataset

Unfortunately, I have tried a few possible variations that have not resulted in either of these results. I do notice that the initial value in the filename field of the download file dialog box turns out to be the variable name assigned to the download button or download link (assuming this is matched by the corresponding "output$" value.

I wonder if there is something I'm missing or if the user will always be expected to supply the complete filename in the dialog box. If so, it would not be difficult to prompt the user to do so.

Patrick Mitchell  Jul 27, 2021 
Printed Page 257
2nd paragraph code block

The code block is identical to the previous version at the bottom of page 256, without the suggested proposed revision, "We could, of course, add session to the arguments of the function:...".

Should perhaps read:

switch_page <- function(i, session) {
updateTabsetPanel(input = 'wizard', selected = paste0('page_', i)
}

server <- function(input, output, session) {
observeEvent(input$page_12, switch_page(2, session))
etc.

Morris Johnson  May 11, 2022