100% Guaranteed Results


STAT240 – Assignment 07 Solved
$ 29.99
Category:

Description

5/5 – (1 vote)

Question 1: Interactive data visualization
Shiny Apps are interactive websites that provide functionality in R such as data visualization, data transfer, and data manipulation. They can be used to create interactive reports, or to prototype project or startup ideas. Shiny Apps can be deployed on public websites, or locally in R Studio sessions. Please follow this tutorial for an example of getting a Shiny App set up locally in an R Studio session: https://shiny.rstudio.com/tutorial/ written-tutorial/lesson1/.
a) SFU hosts a Shiny App server where you can upload code, and get it to run over the internet. When you run an SFU hosted Shiny App, it will be accessible in a website of this form: https:
Deploy this App on SFU’s Shiny App server by following these steps: https://www.rcg.sfu.ca/services/shiny/index.html. Note that you will have to use SFU’s VPN unless you are on a campus network (instructions for this are linked in the first step). Step 2 reads: ‘For this example, we’ll assume you have a Shiny application ready to deploy in a folder called myapp on your computer.’ Here, the folder is the myapp folder included in this assignment. For the 7th step ‘Upload the myapp folder you prepared in step 1 inside the

Plate 1: Problem with title: the text is cut off.
Provide some screenshot in a pdf of the Shiny App working, including the URL. Include a link in the pdf to the Shiny App (with your Compute ID in the URL). The Shiny App must remain live for at least two weeks after you hand in the assignment, so that we can mark it.
(5 points) b) The title of the density plot is cut off in the plot on the right as indicated by the red arrow in Plate 1 (i.e., the top of the text is missing). Also, the title does not change when the selected variable changes, and instead provides meaningless information. Change the code so that the title is not cut off, and so that the title gives the name of the variable being plotted. Provide code and screenshots.
(2 points) c) Make a new Shiny App called myapp2 that shows density plots for the variables in the dataset that you selected for the last question of Assignment 01 (you will have to modify the code
to read in the dataset, and upload the dataset to the myapp2 directory of your SFU Shiny App server). Make the side bar drop down box indicate variables from that dataset. Have the same fix to the title of the density plots that you did in the above part. If there are more than 10 variables in the dataset that you selected in Assignment 01, have the side bar only list the first 5. Provide in a pdf screenshots, code (all of server.R and ui.R), and a URL to your App on SFU’s Shiny App server.
(2 points)
Question 2: Deploying a public website
(5 bonus points)
1. Create a heroku account on https://www.heroku.com/.
2. Download and install the heroku command line interface: https:
//devcenter.heroku.com/articles/heroku-cli. Also: make sure you have the software git installed. You can check if you have git by typing git into a terminal. If you get an error, you can install git here: https://git-scm.com/downloads/.
3. Log in to heroku through the command line interface: Open a terminal on your computer and enter the command heroku login.
5. Enter the following command into the terminal. This will instruct heroku to use Shiny Apps: heroku buildpacks:set https://github.com/virtualstaticvoid/herokubuildpack-r.githeroku-16. This command must be all on one line.
6. Enter the command heroku stack:set heroku-16.
7. Copy the R files from the directory heroku provided in this lab to the directory you are working in: run.R, server.R, ui.R.
8. Commit the files to the git repository you have created using the following commands. First: git add *.R. Second: git commit -m ’Initial commit’.
9. Send your App to heroku with the command git push heroku master.
10. Open a web browser and navigate to the URL https://STAT240-
11. Modify the App so that it works like the App you made in Question 1 Part c).
12. Take screenshots of the App working.
13. After you are done, turn off the App by entering the command heroku ps:scale web=0. You can also turn off the App by navigating to the URL https://dashboard.heroku.com and then logging in (if required) and then clicking on the App name in the list on the left and then clicking the Resources tab and then clicking the edit pencil to the right of the line beggining with web under the text Free Dynos and then clicking and dragging on the blue sliding circle to move it all the way to the left (off position) and then pressing the purple Confirm button.
14. If you’d like to turn the App back on, use the command heroku ps:scale web=1. Always run heroku commands like this in the directory that the App is in (note that the name of the App is not specified, it’s inferred by your current directory).
15. If you’d like to modify the App, modify the files and then update them on heroku using these three commands: 1) git add *.R. 2) git commit -m ’Update’. 3) git push heroku master.

Reviews

There are no reviews yet.

Be the first to review “STAT240 – Assignment 07 Solved”

Your email address will not be published. Required fields are marked *

Related products