<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Shiny | Yuheng&#39;s Blog</title>
    <link>/tag/shiny/</link>
      <atom:link href="/tag/shiny/index.xml" rel="self" type="application/rss+xml" />
    <description>Shiny</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Sun, 25 Oct 2020 00:00:00 +0000</lastBuildDate>
    <image>
      <url>/images/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_512x512_fill_lanczos_center_2.png</url>
      <title>Shiny</title>
      <link>/tag/shiny/</link>
    </image>
    
    <item>
      <title>Package Review --- `AustraliaCOVID19`</title>
      <link>/post/package-review/</link>
      <pubDate>Sun, 25 Oct 2020 00:00:00 +0000</pubDate>
      <guid>/post/package-review/</guid>
      <description>
&lt;link href=&#34;/rmarkdown-libs/anchor-sections/anchor-sections.css&#34; rel=&#34;stylesheet&#34; /&gt;
&lt;script src=&#34;/rmarkdown-libs/anchor-sections/anchor-sections.js&#34;&gt;&lt;/script&gt;


&lt;div id=&#34;overview-of-the-package-australiacovid19&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Overview of the package — &lt;code&gt;AustraliaCOVID19&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The package written by &lt;em&gt;Yiwen Liu&lt;/em&gt; is called &lt;code&gt;AustraliaCOVID19&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;User can install the released version of &lt;code&gt;AustraliaCOVID19&lt;/code&gt; from &lt;a href=&#34;%22etc5523-2020/r-package-assessment-yliu0320%22&#34;&gt;GitHub&lt;/a&gt; with:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# install.packages(&amp;quot;devtools&amp;quot;)
devtools::install_github(&amp;quot;etc5523-2020/r-package-assessment-yliu0320&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;what-does-the-package-do&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;What does the package do&lt;/h2&gt;
&lt;p&gt;The goal of AustraliaCOVID19 is to see the coronavirus data of daily cases and cumulative cases of different types in different states of Australia between 2020-01-12 to 2020-10-02. Besides,the shiny app in this package will give people the whole information about the data with the interactive plots and table.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;possible-improvements&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Possible improvements&lt;/h2&gt;
&lt;div id=&#34;pkgdown-website&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;1. pkgdown website&lt;/h4&gt;
&lt;p&gt;The package does have a pkgdown website and pass the &lt;code&gt;pkgdown check&lt;/code&gt; in &lt;code&gt;Action&lt;/code&gt; tab, but author forgets to set the GitHub Pages setting to correct source. Anyway, I create the pkgdown website by myself. The website is clear and gives some example of how to use the Shiny App. The possible improvements could be don’t forget to change the GitHub setting next time 😄.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;documentation-and-readme.md&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;2. documentation and README.md&lt;/h4&gt;
&lt;p&gt;They are all clear and readable. The possible improvement could be enriching them in the future by adding more details.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;refactor&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;3. refactor&lt;/h4&gt;
&lt;p&gt;Refactor functions are simple but effective, which are good. The possible improvement could be that Yiwen can try to refactor some more complicated functions in the future.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;test_that-function&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;4. &lt;code&gt;test_that&lt;/code&gt; function&lt;/h4&gt;
&lt;p&gt;There is only on unit test. I hope there should be more in the future.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;test_that(&amp;quot;check the date range&amp;quot;, {
  expect_error(dateselection(starttime&amp;gt;endtime))
  
})&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;shiny-app&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;5. Shiny app&lt;/h4&gt;
&lt;p&gt;All plots within the Shiny app are interactive and functional. And the Shiny has clear UI and understandable plots. The possible improvement could be adding more tabs in the Shiny app, in order to make the whole Shiny app page fit to user’s screen.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;what-i-learned-from-reviewing-the-package&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;What I learned from reviewing the package&lt;/h2&gt;
&lt;p&gt;It is funny to review other’s package. I understand it’s not enough to just ensure the package passing all the test. I also realise the importance of documentation. Good documentation can promote the package, teach users how to use the package, and inspire others while poor documentation will confuse users.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;package-review&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Package Review&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Please check off boxes as applicable, and elaborate in comments below.&lt;/em&gt;&lt;/p&gt;
&lt;div id=&#34;documentation&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Documentation&lt;/h4&gt;
&lt;p&gt;The package includes all the following forms of documentation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input type=&#34;checkbox&#34; disabled=&#34;&#34; checked=&#34;&#34; /&gt;
&lt;strong&gt;Installation instructions:&lt;/strong&gt; for the package is found in README&lt;/li&gt;
&lt;li&gt;&lt;input type=&#34;checkbox&#34; disabled=&#34;&#34; checked=&#34;&#34; /&gt;
&lt;strong&gt;Vignette(s)&lt;/strong&gt; demonstrating major functionality that runs successfully locally&lt;/li&gt;
&lt;li&gt;&lt;input type=&#34;checkbox&#34; disabled=&#34;&#34; checked=&#34;&#34; /&gt;
&lt;strong&gt;Function Documentation:&lt;/strong&gt; for all exported functions in R help&lt;/li&gt;
&lt;li&gt;&lt;input type=&#34;checkbox&#34; disabled=&#34;&#34; checked=&#34;&#34; /&gt;
&lt;strong&gt;Examples&lt;/strong&gt; for all exported functions in R Help that run successfully locally&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id=&#34;functionality&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Functionality&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input type=&#34;checkbox&#34; disabled=&#34;&#34; checked=&#34;&#34; /&gt;
&lt;strong&gt;Installation:&lt;/strong&gt; Installation succeeds as documented.&lt;/li&gt;
&lt;li&gt;&lt;input type=&#34;checkbox&#34; disabled=&#34;&#34; checked=&#34;&#34; /&gt;
&lt;strong&gt;Functionality:&lt;/strong&gt; Any functional claims of the software been confirmed.&lt;/li&gt;
&lt;li&gt;&lt;input type=&#34;checkbox&#34; disabled=&#34;&#34; checked=&#34;&#34; /&gt;
&lt;strong&gt;Automated tests:&lt;/strong&gt; Unit tests cover essential functions of the package and a reasonable range of inputs and conditions. All tests pass on the local machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>Shiny App -- Covid-19 Viewer</title>
      <link>/post/shiny-app-covid-19-viewer/</link>
      <pubDate>Sat, 10 Oct 2020 00:00:00 +0000</pubDate>
      <guid>/post/shiny-app-covid-19-viewer/</guid>
      <description>


&lt;div id=&#34;introduce-covid-19-view&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Introduce &lt;code&gt;Covid-19 view&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;This App is used to monitor global covid-19 cases and deaths, and it can compare the covid-19 cases in different countries.&lt;/p&gt;
&lt;p&gt;There are four tabs: &lt;code&gt;Map&lt;/code&gt;, &lt;code&gt;Table&lt;/code&gt;, &lt;code&gt;Graphs&lt;/code&gt;, and `About.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Map&lt;/code&gt;: This tab has two leaflet maps. The first one shows the global &lt;code&gt;cumulative_cases&lt;/code&gt;. The second one shows the global &lt;code&gt;cumulative_deaths&lt;/code&gt;. Because the dataset contains huge amount of values, the leaflet maps take much time to run. So, please be patient.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Table&lt;/code&gt;: This tab shows the latest covid-19 &lt;code&gt;new_cases&lt;/code&gt;, &lt;code&gt;cumulative_cases&lt;/code&gt;, &lt;code&gt;new_deaths&lt;/code&gt;, and &lt;code&gt;cumulative_deaths&lt;/code&gt; of selected countries. User can select multiple countries to compare them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Graphs&lt;/code&gt;: There are one column plot and one line plot in this tab. The column plot help user compare the latest &lt;code&gt;cumulative_cases&lt;/code&gt; and &lt;code&gt;cumulative_deaths&lt;/code&gt; of selected countries. The line plot tells user the &lt;code&gt;new_cases&lt;/code&gt; and &lt;code&gt;new_deaths&lt;/code&gt; of selected countries. With these two plots, user can understand how successful selected countries control the coronavirus pandemic.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;About&lt;/code&gt;: This tab has short introduction about &lt;code&gt;Covid-19 viewer&lt;/code&gt; and its creator. It also contains the &lt;code&gt;Acknowledgments&lt;/code&gt; and &lt;code&gt;References&lt;/code&gt; sections.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can download this App from &lt;a href=&#34;https://github.com/etc5523-2020/shiny-assessment-ycui0008&#34;&gt;Github&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../img/shiny.png&#34; alt =&#34;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;This screenshot is an overview of &lt;code&gt;Covid-19 Viewer&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;self-review&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Self Review&lt;/h2&gt;
&lt;div id=&#34;what-did-i-do-well&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;What did I do well&lt;/h3&gt;
&lt;p&gt;First, this is my first time to do shiny, I did a lot of self study and complete it without any bugs.&lt;/p&gt;
&lt;p&gt;Second, it spends me 3 nights to deal with leaflet output for shiny app. During the process, I have trouble to create circle markers within leaflet maps. Thanks Stuart for helping me solve this problem!&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;what-are-the-points-i-can-improve-on&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;What are the points I can improve on?&lt;/h3&gt;
&lt;p&gt;Loading my leaflet map in the first tab is time-consuming. Every time a user change the slide bar, it would take at least 10 seconds to show the results.&lt;/p&gt;
&lt;p&gt;After completion of my About tab, I know a better way to write texts/paragraphs in shiny.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;what-are-some-things-that-id-like-to-add-thats-plausible&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;What are some things that I’d like to add that’s plausible?&lt;/h3&gt;
&lt;p&gt;First, I want to make the line plot in Graph tab animated. The animated plot would look more entertaining.&lt;/p&gt;
&lt;p&gt;Second, I want to make users be able to upload csv file in a tab called “Upload file”; after uploading the csv file, the App will draw maps and plots based on the latest dataset. This function can release the app maintainer from updating the covid-19 dataset every day.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;what-are-some-things-that-id-like-to-add-that-cannot-be-done-yet-due-to-limitation-in-data-or-technology&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;What are some things that I’d like to add that cannot be done yet due to limitation in data or technology?&lt;/h3&gt;
&lt;p&gt;In my plan, the leaflet map will look like the plot below, this plot is from &lt;a href=&#34;https://covid19.who.int/&#34;&gt;WHO Coronavirus Disease (COVID-19) Dashboard&lt;/a&gt;. But after several-days tries, I still could not figure it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../img/who-dashboard.png&#34; alt =&#34;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;I also plan to make it available for users to upload csv files by themselves. But after two days, I still cannot solve it.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
    </item>
    
  </channel>
</rss>
