Visualizing Data from the British Geological Survey
Minerals are a ubiquitous part of daily life. So much so, it is likely that you are touching something that was mined at this very moment. As computer users, car passengers, and home dwellers, we all rely on machines we build with minerals. The fact that minerals are so much a part of our lives drew me into asking: What minerals do we use? Where do they come from? Who produces minerals? I wanted to incorporate my curiosity with code, and do a bit of data journalism.
It is easy enough to find info on any mineral you like, try Wikipedia. But what if you wanted to know where the majority of cobalt is mined? And what if you wanted to know the most produced mineral for any given country. One place you might look is the British Geological Survey- an organization that annually collects mineral production per country in a series of spreadsheets titled Mineral Production Report. Flipping through numbers in a table isn't so fun. See image below.
And it isn't so fast. Perhaps you might think, "Instead of numbers in a table, can we see these as shapes and trend lines? This would make for a good data visualization report.". I thought the exact same thing, and went about building the application you can see here!
About the App
This application visualizes World Mineral Production, an annual report on common minerals produced by country, from the year 1970 to 2015.
In another, you can select a country, and compare the total recorded production of selected/all minerals by country.
Another graph compares minerals by average price per ton (with data sourced from metal exchange APIs like the London Metal Exchange), and average tonnage produced per year.
The goal here is to show old data in a new way, to reorganize the data, line it up with other datasets, and see the output. As this application evolves, I believe this methodology will show further trends, and foster the creation of new features that expand on the theme of mineral production. To be continued!
About the Data
The British Geological Survey's World Mineral Production is a pdf formatted paper, and is also available for download in Excel. However, they do have certain parameters for downloading (Things like 10 years at a time, and one mineral at a time). Because of the website's specific parameters, I wrote a python script to automatically visit the BGS site, each time requesting a different part of the BGS's report. I parsed the excel files into a data frame, and saved it to a CSV file to pass onto this Shiny app. The code for parsing World Mineral Production can be found here.
Each graph involves restructuring the dataset in R, and incorporating it into Shiny- a web framework in R. You can see the code here.
For comments, questions, or suggestions, please feel welcome to send me an e-mail.