Vanuatu-National-Statistics-Office / vnso-RAP-tradeStats-materials

A collection of scripts needed to develop a reproducible analytical pipeline for trade statistics
GNU General Public License v3.0
0 stars 1 forks source link

Re-created the dashboard using csv files instead of mysql. #87

Closed trara538 closed 3 years ago

trara538 commented 3 years ago

Hi Joe. Please check my Dashboard script and advice me on where I need to fix to be able to have the dashboard run through any browser.

I will send the csv files separately through a google drive. In the meantime, if you could send me your Gmail account for purpose of my sharing the files I used in the dashboard with you.

thanks.

Rara

JosephCrispell commented 3 years ago

Hi @trara538,

The plots disappearing was still remaining for me whenever I resized or refreshed Viewer or browser. I think this was caused by the indentation of the runtime: shiny in the YAML header - I've remove indentation and moved to top level and that seems to have fixed issue so server will refresh when prompted.

Let me know if it works for you.

Thanks,

Joe

JosephCrispell commented 3 years ago

Hi @trara538,

I don't seem to have the trade_billions file used at line 41: https://github.com/Vanuatu-National-Statistics-Office/vnso-RAP-tradeStats-materials/blob/4f545355b5e21c3492ba3f77e69f9a09a0627a2e/R/dashboard.Rmd#L41

The trades.csv for me also doesn't contain the Export_Goods_RBV and Export_Services_RBV that are called here: https://github.com/Vanuatu-National-Statistics-Office/vnso-RAP-tradeStats-materials/blob/4f545355b5e21c3492ba3f77e69f9a09a0627a2e/R/dashboard.Rmd#L149-L154

Would you be able to share these?

JosephCrispell commented 3 years ago

Hi @trara538,

I've had some time to work on the dashboard and I think I've added some fixes to get the Import pages working 👍. Pull down the latest version and let me know what you think.

I think the main issue was that you were treating the user input as a column name in your dplyr and ggplot code. I've updated so you are now filtering by the selected value: https://github.com/Vanuatu-National-Statistics-Office/vnso-RAP-tradeStats-materials/blob/fed030b48682af884f1af88b51b2eea5499f72ff/R/dashboard.Rmd#L553-L558

I then updated the ggplot() code to make it plot value by year: https://github.com/Vanuatu-National-Statistics-Office/vnso-RAP-tradeStats-materials/blob/fed030b48682af884f1af88b51b2eea5499f72ff/R/dashboard.Rmd#L567-L572

Which gives (not sure if this was what you were aiming for): image

I made similar changes to the Import by country code and added a quick section of code so user can select the country by name rather than ISO2 code, which uses the countrycode package: https://github.com/Vanuatu-National-Statistics-Office/vnso-RAP-tradeStats-materials/blob/fed030b48682af884f1af88b51b2eea5499f72ff/R/dashboard.Rmd#L598-L605

I hope the above changes are useful and make sense 😊

trara538 commented 3 years ago

Hi Joe,

I have just made changes to the dashboard Export tabs to read from the classification excel file rather than hard-coding the the parameters within R as how I did earlier.

Please review my dashboard script and provide feedback.

Thanks

Rara