0

I'm having the same issue with this github user so I'm quoting his question here (unfortunately no one answered him on github) Error when executing shiny app inside R markdown using Run Current Chunk

Getting weird error when executing shiny app in a R markdown document. It gives error when I execute code using Run Current Chunk button. The shiny app works fine but when we close the app you see this error message. The error can be replicated by running the shiny app Run Current Chunk button and closing the app using below code.

part1 = part1 %>% mutate(morrate = Deaths...cumulative.total / Cases...cumulative.total)
part1 = part1 %>% group_by(WHO.Region) %>% sample_n(size=3)


ui <- fluidPage(
  selectInput("WHO.Region", label = "Region:", choices = c("Africa", "Americas", "Eastern Mediterranean", "Europe", "South-East Asia", "Western Pacific")),
  plotOutput("plot"))

server <- function(input, output){
    output$plot <- renderPlot({
      part1 <- part1[part1$WHO.Region == input$WHO.Region, ]
      p <- ggplot(part1, aes(x=Name, y=morrate)) + geom_bar(stat='identity') +xlab("Name") + ylab("Mortality rate") + 
        ggtitle("WHO Region:", input$WHO.Region)
      print(p)
    })
}

shinyApp(ui = ui, server = server) 
structure(list(Name = c("United States of America", "India", 
"France", "Germany", "Brazil", "Republic of Korea", "The United Kingdom", 
"Italy", "Japan", "Russian Federation", "Türkiye", "Spain", 
"Viet Nam", "Australia", "Argentina", "China", "Netherlands", 
"Iran (Islamic Republic of)", "Mexico", "Indonesia", "Poland", 
"Colombia", "Portugal", "Austria", "Ukraine", "Greece", "Malaysia", 
"Chile", "Thailand", "Israel", "Belgium", "Canada", "Switzerland", 
"Peru", "Czechia", "South Africa", "Philippines", "Denmark", 
"Romania", "Sweden", "Iraq", "Serbia", "Hungary", "Singapore", 
"Bangladesh", "Slovakia", "New Zealand", "Georgia", "Jordan", 
"Ireland", "Pakistan", "Kazakhstan", "Norway", "Finland", "Bulgaria", 
"Lithuania", "Morocco", "Croatia", "Slovenia", "Lebanon", "Tunisia", 
"Guatemala", "Costa Rica", "Cuba", "Bolivia (Plurinational State of)", 
"United Arab Emirates", "Ecuador", "Nepal", "Belarus", "Puerto Rico", 
"Panama", "Uruguay", "Mongolia", "Latvia", "Saudi Arabia", "Azerbaijan", 
"Paraguay", "occupied Palestinian territory, including east Jerusalem", 
"Bahrain", "Sri Lanka", "Kuwait", "Dominican Republic", "Myanmar", 
"Estonia", "Cyprus", "Republic of Moldova", "Venezuela (Bolivarian Republic of)", 
"Egypt", "Libya", "Ethiopia", "Réunion", "Qatar", "Honduras", 
"Armenia", "Bosnia and Herzegovina", "Oman", "North Macedonia", 
"Kenya", "Zambia", "Albania", "Botswana", "Luxembourg", "Montenegro", 
"Kosovo[1]", "Algeria", "Mauritius", "Nigeria", "Zimbabwe", "Uzbekistan", 
"Brunei Darussalam", "Mozambique", "Martinique", "Lao People's Democratic Republic", 
"Iceland", "Kyrgyzstan", "Afghanistan", "El Salvador", "Guadeloupe", 
"Maldives", "Trinidad and Tobago", "Ghana", "Namibia", "Uganda", 
"Jamaica", "Cambodia", "Rwanda", "Cameroon", "Malta", "Barbados", 
"Angola", "French Guiana", "Democratic Republic of the Congo", 
"Senegal", "Malawi", "Côte d’Ivoire", "Suriname", "French Polynesia", 
"New Caledonia", "Eswatini", "Guyana", "Belize", "Fiji", "Madagascar", 
"Sudan", "Mauritania", "Cabo Verde", "Bhutan", "Jersey", "Syrian Arab Republic", 
"Burundi", "Seychelles", "Guam", "Gabon", "Andorra", "Papua New Guinea", 
"Curaçao", "Aruba", "Mayotte", "United Republic of Tanzania", 
"Togo", "Guinea", "Isle of Man", "Bahamas", "Faroe Islands", 
"Lesotho", "Haiti", "Mali", "Guernsey", "Cayman Islands", "Saint Lucia", 
"Benin", "Somalia", "Congo", "United States Virgin Islands", 
"Timor-Leste", "Micronesia (Federated States of)", "San Marino", 
"Burkina Faso", "Solomon Islands", "Liechtenstein", "Gibraltar", 
"Grenada", "Bermuda", "South Sudan", "Tajikistan", "Equatorial Guinea", 
"Tonga", "Samoa", "Dominica", "Djibouti", "Marshall Islands", 
"Central African Republic", "Nicaragua", "Monaco", "Northern Mariana Islands (Commonwealth of the)", 
"Gambia", "Saint Martin", "Vanuatu", "Greenland", "Yemen", "Sint Maarten", 
"Eritrea", "Bonaire", "Saint Vincent and the Grenadines", "Niger", 
"Antigua and Barbuda", "Comoros", "Guinea-Bissau", "American Samoa", 
"Liberia", "Sierra Leone", "Chad", "British Virgin Islands", 
"Saint Kitts and Nevis", "Turks and Caicos Islands", "Cook Islands", 
"Sao Tome and Principe", "Palau", "Saint Barthélemy", "Nauru", 
"Anguilla", "Kiribati", "Wallis and Futuna", "Saint Pierre and Miquelon", 
"Saint Helena", "Falkland Islands (Malvinas)", "Montserrat", 
"Sint Eustatius", "Saba", "Tuvalu", "Niue", "Holy See", "Pitcairn Islands", 
"Democratic People's Republic of Korea", "Tokelau", "Turkmenistan"
), WHO.Region = c("Americas", "South-East Asia", "Europe", "Europe", 
"Americas", "Western Pacific", "Europe", "Europe", "Western Pacific", 
"Europe", "Europe", "Europe", "Western Pacific", "Western Pacific", 
"Americas", "Western Pacific", "Europe", "Eastern Mediterranean", 
"Americas", "South-East Asia", "Europe", "Americas", "Europe", 
"Europe", "Europe", "Europe", "Western Pacific", "Americas", 
"South-East Asia", "Europe", "Europe", "Americas", "Europe", 
"Americas", "Europe", "Africa", "Western Pacific", "Europe", 
"Europe", "Europe", "Eastern Mediterranean", "Europe", "Europe", 
"Western Pacific", "South-East Asia", "Europe", "Western Pacific", 
"Europe", "Eastern Mediterranean", "Europe", "Eastern Mediterranean", 
"Europe", "Europe", "Europe", "Europe", "Europe", "Eastern Mediterranean", 
"Europe", "Europe", "Eastern Mediterranean", "Eastern Mediterranean", 
"Americas", "Americas", "Americas", "Americas", "Eastern Mediterranean", 
"Americas", "South-East Asia", "Europe", "Americas", "Americas", 
"Americas", "Western Pacific", "Europe", "Eastern Mediterranean", 
"Europe", "Americas", "Eastern Mediterranean", "Eastern Mediterranean", 
"South-East Asia", "Eastern Mediterranean", "Americas", "South-East Asia", 
"Europe", "Europe", "Europe", "Americas", "Eastern Mediterranean", 
"Eastern Mediterranean", "Africa", "Africa", "Eastern Mediterranean", 
"Americas", "Europe", "Europe", "Eastern Mediterranean", "Europe", 
"Africa", "Africa", "Europe", "Africa", "Europe", "Europe", "Europe", 
"Africa", "Africa", "Africa", "Africa", "Europe", "Western Pacific", 
"Africa", "Americas", "Western Pacific", "Europe", "Europe", 
"Eastern Mediterranean", "Americas", "Americas", "South-East Asia", 
"Americas", "Africa", "Africa", "Africa", "Americas", "Western Pacific", 
"Africa", "Africa", "Europe", "Americas", "Africa", "Americas", 
"Africa", "Africa", "Africa", "Africa", "Americas", "Western Pacific", 
"Western Pacific", "Africa", "Americas", "Americas", "Western Pacific", 
"Africa", "Eastern Mediterranean", "Africa", "Africa", "South-East Asia", 
"Europe", "Eastern Mediterranean", "Africa", "Africa", "Western Pacific", 
"Africa", "Europe", "Western Pacific", "Americas", "Americas", 
"Africa", "Africa", "Africa", "Africa", "Europe", "Americas", 
"Europe", "Africa", "Americas", "Africa", "Europe", "Americas", 
"Americas", "Africa", "Eastern Mediterranean", "Africa", "Americas", 
"South-East Asia", "Western Pacific", "Europe", "Africa", "Western Pacific", 
"Europe", "Europe", "Americas", "Americas", "Africa", "Europe", 
"Africa", "Western Pacific", "Western Pacific", "Americas", "Eastern Mediterranean", 
"Western Pacific", "Africa", "Americas", "Europe", "Western Pacific", 
"Africa", "Americas", "Western Pacific", "Europe", "Eastern Mediterranean", 
"Americas", "Africa", "Americas", "Americas", "Africa", "Americas", 
"Africa", "Africa", "Western Pacific", "Africa", "Africa", "Africa", 
"Americas", "Americas", "Americas", "Western Pacific", "Africa", 
"Western Pacific", "Americas", "Western Pacific", "Americas", 
"Western Pacific", "Western Pacific", "Americas", "Africa", "Americas", 
"Americas", "Americas", "Americas", "Western Pacific", "Western Pacific", 
"Europe", "Western Pacific", "South-East Asia", "Western Pacific", 
"Europe"), Cases...cumulative.total = c(96474411L, 44664810L, 
35964696L, 35932654L, 34877559L, 26091539L, 23930041L, 23642011L, 
22956237L, 21477926L, 16919638L, 13529643L, 11507540L, 10402258L, 
9720232L, 9258687L, 8525378L, 7558690L, 7115360L, 6544201L, 6345188L, 
6310332L, 5524686L, 5472671L, 5312632L, 5250288L, 4940456L, 4818999L, 
4695207L, 4692568L, 4619721L, 4357478L, 4256107L, 4165187L, 4163425L, 
4031096L, 4014039L, 3339619L, 3290030L, 2614997L, 2461663L, 2410231L, 
2153564L, 2134319L, 2036061L, 1853864L, 1852595L, 1785138L, 1746997L, 
1673665L, 1574470L, 1485340L, 1465816L, 1360721L, 1282284L, 1270708L, 
1266231L, 1248864L, 1240194L, 1219297L, 1146702L, 1143697L, 1140864L, 
1111311L, 1109730L, 1040133L, 1009388L, 1000784L, 994037L, 991468L, 
991251L, 991219L, 986599L, 955943L, 824151L, 823577L, 717980L, 
703036L, 692638L, 671369L, 662359L, 647717L, 632522L, 607844L, 
602662L, 594070L, 546202L, 515412L, 507060L, 494042L, 478346L, 
472587L, 457196L, 445397L, 400115L, 398775L, 344342L, 339788L, 
333685L, 331944L, 326324L, 303571L, 283138L, 272140L, 270847L, 
268397L, 266192L, 257893L, 244878L, 244599L, 230475L, 223728L, 
216323L, 206803L, 206464L, 204173L, 201785L, 196270L, 185454L, 
184949L, 170894L, 169929L, 169378L, 152306L, 137996L, 132611L, 
123993L, 115532L, 103424L, 103131L, 94259L, 93466L, 88826L, 88009L, 
87839L, 81228L, 76797L, 74577L, 73618L, 71461L, 68972L, 68287L, 
66788L, 63561L, 63392L, 62589L, 62430L, 62014L, 57374L, 50574L, 
49380L, 49174L, 48945L, 46588L, 45721L, 45507L, 43423L, 40339L, 
40152L, 39314L, 38122L, 38008L, 37433L, 34658L, 34490L, 33828L, 
32741L, 32562L, 31194L, 29676L, 27912L, 27243L, 24775L, 23435L, 
23312L, 22032L, 21739L, 21631L, 21544L, 20741L, 20121L, 19604L, 
18428L, 18325L, 17786L, 17085L, 16182L, 15949L, 15760L, 15690L, 
15386L, 15288L, 15203L, 15044L, 13171L, 12580L, 12026L, 11981L, 
11971L, 11945L, 10931L, 10189L, 9554L, 9459L, 9430L, 9106L, 8879L, 
8848L, 8260L, 7998L, 7758L, 7631L, 7305L, 6552L, 6431L, 6389L, 
6275L, 5530L, 5323L, 4610L, 3866L, 3430L, 3415L, 3230L, 2115L, 
1930L, 1403L, 1204L, 732L, 466L, 85L, 26L, 4L, 0L, 0L, 0L), Cases...cumulative.total.per.100000.population = c(29146.114, 
3236.57, 55296.818, 43205.573, 16408.381, 50891.269, 35250.331, 
39640.21, 18150.6, 14717.515, 20061.448, 28584.187, 11822.178, 
40793.354, 21506.949, 629.292, 48975.076, 8999.196, 5518.66, 
2392.554, 16716.278, 12401.677, 53659.041, 61483.335, 12147.668, 
48983.124, 15264.34, 25208.978, 6726.66, 54214.612, 40093.253, 
11545.388, 49177.295, 12632.553, 38932.567, 6796.805, 3663.077, 
57354.541, 17021.354, 25320.498, 6120.115, 34796.213, 22043.69, 
36481.953, 1236.304, 33966.785, 38417.783, 44749.553, 17122.161, 
33713.067, 712.777, 7910.546, 27308.694, 24627.133, 18446.196, 
45478.421, 3430.539, 30774.106, 59173.485, 17863.993, 9702.504, 
6383.817, 22395.712, 9811.501, 9506.793, 10516.59, 5721.164, 
3434.776, 10519.666, 34656.377, 22973.454, 28534.716, 30094.928, 
50110.37, 2367.306, 8122.722, 10066.263, 13781.199, 40705.699, 
3135.297, 15509.846, 5970.892, 1162.515, 45737.771, 67866.96, 
14726.709, 1920.816, 503.655, 7379.398, 429.738, 53427.855, 16403.273, 
4615.993, 15030.774, 12195.598, 7808.972, 16528.046, 631.913, 
1815.088, 11534.645, 13876.52, 48485.405, 45081.218, 15155.38, 
617.652, 21104.242, 129.132, 1735.143, 731.652, 55911.027, 737.392, 
59618.669, 2973.283, 56793.104, 3164.592, 524.484, 3110.987, 
49052.294, 34308.77, 13215.476, 549.977, 6687.735, 370.298, 5143.445, 
825.386, 1023.848, 467.09, 22452.406, 35989.213, 313.79, 31558.313, 
104.36, 530.497, 460.059, 332.998, 13846.5, 27338.844, 26121.724, 
6345.482, 9085.35, 17345.861, 7617.534, 241.19, 144.953, 1363.369, 
11257.278, 8090.896, 57529.036, 327.839, 425.321, 50209.971, 
29135.832, 2199.05, 60296.383, 511.019, 27732.444, 40671.187, 
14786.21, 67.218, 474.88, 290.281, 44698.466, 9519.026, 70926.021, 
1609.99, 296.671, 161.677, 50508.78, 47465.003, 16161.022, 230.236, 
171.413, 448.978, 22441.944, 1768.144, 19154.43, 64055.042, 103.481, 
3136.483, 53529.305, 59722.181, 17422.216, 29592.279, 163.708, 
186.482, 1217.761, 15310.09, 8038.243, 21891.625, 1588.057, 25992.499, 
316.537, 229.495, 38334.522, 22883.403, 520.551, 31107.892, 3900.763, 
21086.099, 40.049, 25490.882, 287.304, 45680.134, 8526.23, 38.956, 
9298.573, 1021.043, 449.593, 14964.581, 158.136, 97.255, 46.457, 
24159.143, 12317.642, 16609.846, 36375.541, 2863.218, 30565.996, 
53849.267, 42551.228, 25769.897, 2871.518, 30366.352, 55737.705, 
34837.753, 55412.001, 28065.613, 38356.164, 37868.598, 3951.832, 
5253.399, 3213.844, 8000, 0, 0, 0), Cases...newly.reported.in.last.7.days = c(0L, 
6445L, 121692L, 132579L, 38222L, 289975L, 0L, 0L, 347690L, 24259L, 
0L, 17875L, 2271L, 0L, 1357L, 153635L, 4878L, 728L, 2798L, 31288L, 
2091L, 616L, 0L, 20018L, 0L, 61398L, 21539L, 49361L, 2759L, 4967L, 
1320L, 20628L, 8815L, 6653L, 2477L, 1600L, 7404L, 2729L, 1715L, 
0L, 0L, 3397L, 4556L, 18698L, 316L, 568L, 0L, 0L, 0L, 0L, 235L, 
236L, 457L, 0L, 1700L, 1325L, 443L, 1186L, 3336L, 310L, 109L, 
3025L, 2448L, 21L, 218L, 1595L, 1353L, 86L, 0L, 6927L, 838L, 
659L, 947L, 1713L, 948L, 159L, 25L, 0L, 1564L, 59L, 286L, 64L, 
383L, 277L, 0L, 347L, 251L, 6L, 9L, 46L, 0L, 2154L, 0L, 155L, 
97L, 0L, 196L, 349L, 0L, 75L, 0L, 546L, 130L, 9L, 0L, 882L, 54L, 
0L, 139L, 0L, 0L, 0L, 58L, 189L, 12L, 713L, 0L, 0L, 90L, 95L, 
0L, 0L, 0L, 0L, 1L, 26L, 0L, 85L, 0L, 0L, 0L, 123L, 11L, -90L, 
17L, 0L, 33L, 127L, 60L, 23L, 15L, 17L, 42L, 43L, 7L, 60L, 50L, 
0L, 9L, 57L, 0L, 0L, 0L, 0L, 156L, 18L, 44L, 0L, 88L, 4L, 0L, 
0L, 27L, 0L, 0L, 0L, 3L, 96L, 98L, 22L, 0L, 6L, 0L, 68L, 9L, 
0L, 76L, 0L, 0L, 36L, 0L, 0L, 0L, 0L, 0L, 8L, 0L, 0L, 0L, 0L, 
4L, 0L, 17L, 49L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 23L, 0L, 1L, 
0L, 0L, 0L, 3L, 0L, 4L, 4L, 0L, 3L, 0L, 0L, 5L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 70L, 7L, 0L, 0L, 0L, 303L, 0L, 0L, 0L, 0L, 0L, 0L
), Cases...newly.reported.in.last.7.days.per.100000.population = c(0, 
0.467, 187.105, 159.414, 17.982, 565.593, 0, 0, 274.905, 16.623, 
0, 37.765, 2.333, 0, 3.002, 10.442, 28.022, 0.867, 2.17, 11.439, 
5.509, 1.211, 0, 224.894, 0, 572.819, 66.548, 258.216, 3.953, 
57.385, 11.456, 54.655, 101.853, 20.178, 23.163, 2.698, 6.757, 
46.868, 8.873, 0, 0, 49.042, 46.635, 319.605, 0.192, 10.407, 
0, 0, 0, 0, 0.106, 1.257, 8.514, 0, 24.455, 47.422, 1.2, 29.225, 
159.171, 4.542, 0.922, 16.885, 48.055, 0.185, 1.868, 16.127, 
7.669, 0.295, 0, 242.131, 19.422, 18.971, 28.887, 89.795, 2.723, 
1.568, 0.351, 0, 91.915, 0.276, 6.697, 0.59, 0.704, 20.843, 0, 
8.602, 0.883, 0.006, 0.131, 0.04, 0, 74.764, 0, 5.231, 2.957, 
0, 9.408, 0.649, 0, 2.606, 0, 87.205, 20.699, 0.501, 0, 69.352, 
0.026, 0, 0.415, 0, 0, 0, 0.797, 51.904, 0.184, 1.832, 0, 0, 
16.65, 6.788, 0, 0, 0, 0, 0.006, 0.201, 0, 16.519, 0, 0, 0, 0.137, 
0.066, -0.47, 0.064, 0, 11.748, 44.484, 5.172, 2.924, 3.772, 
1.896, 0.152, 0.098, 0.151, 10.792, 6.48, 0, 0.051, 0.479, 0, 
0, 0, 0, 1.744, 10.969, 41.212, 0, 0.147, 0.048, 0, 0, 6.866, 
0, 0, 0, 0.015, 148.911, 149.117, 11.981, 0, 0.038, 0, 65.119, 
0.683, 0, 223.938, 0, 0, 92.91, 0, 0, 0, 0, 0, 0.57, 0, 0, 0, 
0, 6.757, 0, 0.257, 124.86, 0, 0, 0, 0, 0, 0.003, 0, 0, 109.969, 
0, 0.004, 0, 0, 0, 5.435, 0, 0.05, 0.024, 0, 5.64, 0, 0, 2.281, 
0, 0, 0, 0, 0, 0, 0, 1153.023, 200.976, 0, 0, 0, 2569.539, 0, 
0, 0, 0, 0, 0), Cases...newly.reported.in.last.24.hours = c(0L, 
842L, 0L, 0L, 9406L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 1931L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 8225L, 0L, 
0L, 0L, 0L, 0L, 1861L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 479L, 2448L, 8L, 40L, 0L, 104L, 9L, 0L, 1536L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 65L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, -90L, 0L, 
0L, 0L, 0L, 0L, 8L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 4L, 0L, 0L, 0L, 0L, 
0L, 0L, 22L, 0L, 0L, 0L, 22L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L), Deaths...cumulative.total = c(1062721L, 
530520L, 153957L, 155012L, 688567L, 29571L, 194704L, 179436L, 
47336L, 390774L, 101203L, 115239L, 43166L, 14939L, 130003L, 29112L, 
22857L, 144605L, 330418L, 158989L, 118195L, 141850L, 25254L, 
21049L, 110186L, 33888L, 36522L, 61923L, 32995L, 11784L, 32959L, 
46710L, 13676L, 217129L, 41682L, 102363L, 64329L, 7420L, 67217L, 
20753L, 25361L, 17294L, 48111L, 1693L, 29426L, 20651L, 2119L, 
16912L, 14122L, 8066L, 30629L, 19053L, 4238L, 6741L, 37936L, 
9404L, 16283L, 17200L, 8489L, 10716L, 29263L, 19913L, 9019L, 
8530L, 22241L, 2348L, 35935L, 12019L, 7118L, 5291L, 8509L, 7526L, 
2131L, 6070L, 9425L, 9957L, 19606L, 5708L, 1530L, 16783L, 2569L, 
4384L, 19486L, 2757L, 1200L, 11900L, 5823L, 24798L, 6437L, 7572L, 
899L, 684L, 11039L, 8709L, 16182L, 4628L, 9564L, 5678L, 4017L, 
3593L, 2782L, 1151L, 2787L, 3192L, 6881L, 1033L, 3155L, 5606L, 
1637L, 136L, 2224L, 1047L, 757L, 219L, 2991L, 7829L, 4230L, 993L, 
309L, 4257L, 1460L, 4080L, 3630L, 3350L, 3056L, 1467L, 1965L, 
808L, 560L, 1917L, 411L, 1447L, 1968L, 2685L, 829L, 1392L, 649L, 
314L, 1422L, 1281L, 687L, 878L, 1411L, 4980L, 997L, 410L, 21L, 
141L, 3163L, 15L, 171L, 404L, 306L, 155L, 668L, 293L, 234L, 187L, 
845L, 290L, 458L, 116L, 833L, 28L, 706L, 860L, 742L, 65L, 36L, 
408L, 163L, 1361L, 386L, 124L, 138L, 58L, 119L, 387L, 153L, 86L, 
108L, 237L, 149L, 138L, 125L, 183L, 12L, 29L, 74L, 189L, 17L, 
113L, 245L, 65L, 40L, 372L, 46L, 14L, 21L, 2159L, 89L, 103L, 
31L, 116L, 314L, 146L, 160L, 176L, 34L, 294L, 125L, 194L, 64L, 
46L, 36L, 1L, 77L, 7L, 5L, 1L, 12L, 13L, 7L, 1L, 0L, 0L, 8L, 
5L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Deaths...cumulative.total.per.100000.population = c(321.061, 
38.443, 236.714, 186.387, 323.941, 57.678, 286.81, 300.858, 37.427, 
267.774, 119.995, 243.466, 44.346, 58.585, 287.644, 1.979, 131.305, 
172.163, 256.272, 58.126, 311.383, 278.777, 245.282, 236.477, 
251.947, 316.162, 112.841, 323.929, 47.271, 136.144, 286.042, 
123.761, 158.02, 658.528, 389.772, 172.594, 58.704, 127.431, 
347.755, 200.947, 63.052, 249.671, 492.46, 28.938, 17.868, 378.371, 
43.942, 423.947, 138.408, 162.476, 13.866, 101.471, 78.956, 122.003, 
545.725, 336.568, 44.115, 423.837, 405.036, 157.001, 247.601, 
111.149, 177.047, 75.309, 190.533, 23.74, 203.678, 41.25, 75.328, 
184.945, 197.206, 216.655, 65.003, 318.188, 27.073, 98.203, 274.881, 
111.891, 89.917, 78.377, 60.156, 40.413, 35.813, 207.453, 135.134, 
294.995, 20.478, 24.232, 93.68, 6.586, 100.412, 23.741, 111.453, 
293.902, 493.231, 90.627, 459.062, 10.56, 21.851, 124.852, 118.301, 
183.834, 443.746, 177.761, 15.692, 81.226, 1.531, 37.718, 4.891, 
31.087, 7.116, 279.003, 10.405, 60.143, 45.845, 20.111, 65.215, 
248.173, 57.165, 304.183, 4.699, 160.573, 7.936, 113.131, 18.279, 
11.326, 7.402, 157.026, 194.867, 5.833, 137.605, 1.616, 11.754, 
14.036, 3.143, 237.287, 231.036, 109.983, 122.569, 162.863, 172.775, 
97.942, 5.096, 11.357, 21.442, 73.743, 2.722, 130.803, 18.074, 
0.126, 173.874, 239.372, 13.748, 200.608, 7.466, 178.557, 219.171, 
68.545, 1.415, 3.503, 3.487, 136.419, 211.828, 57.301, 32.956, 
7.542, 3.664, 100.825, 54.778, 222.19, 1.345, 8.563, 6.995, 118.746, 
10.467, 50.425, 350.639, 1.851, 22.275, 221.953, 320.56, 210.624, 
239.269, 1.233, 1.311, 13.044, 11.353, 14.616, 102.791, 19.13, 
28.719, 2.34, 3.698, 165.63, 69.496, 15.393, 118.989, 4.558, 
36.99, 7.239, 207.546, 2.904, 148.219, 104.561, 1.297, 149.088, 
18.399, 8.943, 61.598, 5.813, 1.567, 1.181, 211.661, 86.479, 
92.98, 5.693, 35.134, 38.691, 50.582, 9.23, 79.989, 10.883, 62.244, 
17.256, 0, 0, 160.032, 159.286, 103.466, 0, 0, 0, 0, 0, 0, 0), 
    Deaths...newly.reported.in.last.7.days = c(0L, 41L, 347L, 
    71L, 339L, 256L, 0L, 0L, 427L, 315L, 0L, 161L, 1L, 0L, 12L, 
    442L, 14L, 22L, 15L, 221L, 38L, 13L, 0L, 13L, 0L, 138L, 42L, 
    198L, 40L, 2L, 11L, 293L, 1L, 104L, 34L, 0L, 150L, 45L, 14L, 
    0L, 0L, 33L, 92L, 10L, 1L, 27L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 
    0L, 33L, 4L, 2L, 35L, 5L, 5L, 4L, 18L, 10L, 0L, 2L, 0L, 15L, 
    0L, 0L, 23L, 0L, 8L, 0L, 8L, 10L, 6L, 5L, 0L, 1L, 1L, 1L, 
    0L, 2L, 9L, 0L, 6L, 3L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 0L, 
    0L, 0L, 0L, 0L, 0L, 4L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 4L, 0L, 0L, 1L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 1L, 0L, 2L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 8L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, 
    0L, 0L, 0L, 0L, 3L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L), Deaths...newly.reported.in.last.7.days.per.100000.population = c(0, 
    0.003, 0.534, 0.085, 0.159, 0.499, 0, 0, 0.338, 0.216, 0, 
    0.34, 0.001, 0, 0.027, 0.03, 0.08, 0.026, 0.012, 0.081, 0.1, 
    0.026, 0, 0.146, 0, 1.287, 0.13, 1.036, 0.057, 0.023, 0.095, 
    0.776, 0.012, 0.315, 0.318, 0, 0.137, 0.773, 0.072, 0, 0, 
    0.476, 0.942, 0.171, 0.001, 0.495, 0, 0, 0, 0, 0, 0.005, 
    0, 0, 0.475, 0.143, 0.005, 0.862, 0.239, 0.073, 0.034, 0.1, 
    0.196, 0, 0.017, 0, 0.085, 0, 0, 0.804, 0, 0.23, 0, 0.419, 
    0.029, 0.059, 0.07, 0, 0.059, 0.005, 0.023, 0, 0.004, 0.677, 
    0, 0.149, 0.011, 0, 0, 0, 0, 0, 0, 0, 0.061, 0, 0, 0, 0, 
    0, 0, 0.639, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01, 
    0, 0, 0.185, 0.143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.001, 
    0, 0.01, 0.004, 0, 0, 0, 0, 0, 0, 0, 0, 0.018, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0.937, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 1.551, 1.522, 0.545, 0, 0, 0, 0, 0, 2.608, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0.003, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 
    Deaths...newly.reported.in.last.24.hours = c(0L, 6L, 0L, 
    0L, 80L, 40L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 75L, 0L, 
    0L, 12L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 8L, 53L, 0L, 0L, 0L, 
    0L, 0L, 26L, 0L, 0L, 7L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 3L, 10L, 0L, 0L, 0L, 1L, 0L, 0L, 6L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L)), class = "data.frame", row.names = c(NA, 
-236L))

Given that the shinyApp still runs and gives me the desired output, my friend told me that this error is due to the nature of Rmd files. When I knit to html, the error disappears. So just wondering if I could just ignore this error when I use the Run Current Chunk button in Rmarkdown.

stefan
  • 90,330
  • 6
  • 25
  • 51
yuuhuuxuu
  • 1
  • 1
  • Welcome to SO. Unfortunately we can't run your code as we don't have your data. Also, I'm not able to reproduce the issue when running the code in the link you referenced. – stefan Nov 13 '22 at 19:16
  • Hi do you know if there is a way for me to add the dataset? – yuuhuuxuu Nov 13 '22 at 19:22
  • You could post your data typing `dput(NAME_OF_DATASET)` in the console and pasting the output into your post. If you data has a lot of observations then do e.g. `dput(head(NAME_OF_DATASET, 10))` for the first 10 rows. For more on this see [How to make a great reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – stefan Nov 13 '22 at 19:33
  • 1
    I tried the dput, but it just gives me structure(...), should i paste the whole structure here? – yuuhuuxuu Nov 13 '22 at 19:58
  • Yep. Looks at a bit weird the first time. (; – stefan Nov 13 '22 at 19:59
  • 1
    can you see it now? the original dataset has 236 observations and 12 variables, then i used tidyverse to tranform the dataset, thank you so much for your guidance stefan! – yuuhuuxuu Nov 13 '22 at 20:06
  • Yep. But I'm still unable to reproduce your issue. When I run the app using the `Run Current Chunk` it works fine and when I stop it I don't get any error messages or warnings or ... – stefan Nov 13 '22 at 20:12
  • I see, that's so strange because when I copy my code into split files and use the function deployApp(), it will generate an error saying "An error has occurred. Check your logs or contact the app author for clarification". So I thought it must be due to the “no loop for break/next, jumping to top level” error I'm getting. – yuuhuuxuu Nov 13 '22 at 21:36

0 Answers0