Experience learning (basic) R programming

Hello everyone! As mentioned before, I'm currently in a Masters of Data Science program.  This last semester I had my first introduction to the R programming language.  For those who don't know, R is a free programming language primarily used for statistical analysis.  Prior to learning R, the only exposure to programming I had was during my undergraduate studies; I had spent two years as a Mechanical Engineering major (before switching to International Relations), and one of my courses was studying MATLAB.  I was admittedly nervous about learning R, since I had last studied any sort of programming over ten years ago, and had also only ever dabbled with HTML when I was younger.  But honestly, I think that my background in foreign language learning really helped.  Programming languages (to me at least) seem very intuitive and logical.  You might need to do things in a certain order, but that's no different from learning a rigid grammar structure.  Learning all of the arguments in a function is like learning the different tenses for verb conjugation.  And, although I have only had the one semester in R, I feel comfortable with using the language.  My coding is probably clunky at times, and certainly doesn't always look pretty.  But that's very much like first getting conversational with a language; you can get your meaning across well enough, and can continue to improve with (hopefully gentle) corrections from native speakers.  One of my favorite uses of R (so far) has been mapping locational data.  I have some experience with geographic information systems (GIS), mostly using ArcGIS and some dabbling at home with QGIS.  Mapping in R is not very straightforward, as you have to define the shapefile elements to provide the basemap in addition to the data you want to map, but you do have a good amount of control over the aesthetics of the plot.  The map below is an example of what you can create with R:
I plotted similar maps in my final project in my R class.  My group was looking at conflict data by manipulating the Geo-referenced Event Dataset from the Uppsala Conflict Data Program at the University of Uppsala, Sweden.  This map shows all of the observations from the dataset that occurred in the PRC.  The large red spot in the northeast represents the Tiananmen Square Massacre in 1989.  Most other instances of violence involve ethnic minorities like the Tibetans and Uighur people.  There are more advanced mapping techniques that I haven't learned yet, such as using Leaflet to make interactive maps.  I'm sure I'll delve more into that in later posts. 

There are plenty of online resources for learning R like tutorials, GitHub, and Stack Overflow.  For my personal style, I liked having a structured class that guided us through a logical approach to learning the main packages in the Tidyverse, which is generally accepted to be a great starting point to learning R for data science.  I'll definitely be posting some R tidbits on this blog.

Comments

Popular posts from this blog

Hello World! 【 你好,世界!】