Through this weekly series, I hope to narrate my foray into data science, its relevance in today’s market and applications within the healthcare sector.
For week 1, I have been reviewing R (open source programming for statistical computing) and from my experience R has been a more straight-forward programming language. To start with the basics, it is important to understand the style of language(s) used within R. The styles include:
a) Object-oriented: A style that uses “objects” to design interactions, store data and execute code. An object can be described as a class, a description of the object, this can also include the methods or behaviors of the class which can be used to assign or store data. An example of a class could be a bike, where the class would contain the blueprint for the bike, this would be followed by defining an object (s) related to the bike, such as wheeled bikes (divided into two-wheeled or one-wheeled). As such we have created a hierarchy for the class “bike” defined by objects and their respective functions (i.e., attributes describing the object).
b) Imperative: A style that uses direct statements to change a particular program, providing a step-by-step approach to executing the code. This style of programming considers the “how” or the specific steps required to reach the final conclusion, best represented by a sandwich recipe, which states all the ingredients and the steps required to get to the finished product. In the case of imperative, the user would be interested in defining all the steps needed (would require more line of code) and in most cases provides extensive detail to an otherwise simple procedure. The imperative style is best seen within HTML code, as a user is responsible for describing the different layers/steps associated with organizing a page (i.e., title, headings, paragraph)
c) Functional: Unlike the imperative style, the functional approach is focused on describing the result required and the necessary computation/equation needed to achieve the final result. The functional style removes all unnecessary filler and side effects not directly related to the end result. Thus, reducing complexity and length of the code. In short, the functional style follows the concept of an input defined, a computation and an output.
With R, one is able to use a mix of all three styles or stick to one depending on the nature of the work. As a beginner and perhaps to better understand the direction of the code, the imperative style might be the best to follow.
For week 2, I will be looking at some of the basic R functions and analysis used. If you’re interested in downloading R and following along, please find the following download link: https://www.r-project.org/