R is one tool that is great for data analysis and since there is so much value to not just data but the ability to analyze and interpret data, it is important we share what we know with you. Being a Data science graduate student, I have just started learning this tool and I would be sharing my journey with you, just so we can learn together. If you get confused along the line, please reach out to me.
First, lets start with how to install R on your desktop:
- Download the right package for your PC here: https://cloud.r-project.org/ For Windows, use this:
https://cran.r-project.org/bin/windows/base/ - Then download R-Studio: https://www.rstudio.com/products/rstudio/download/
Now that we have this sorted, let’s move the main deal.
If you are already familiar with some programming languages (Python, SQL, etc) you might not have issues with learning this as most of the languages are similar.
Today, we would start with the basics. Some of the key things you should be aware of are the types of data types we have which include:
- Decimal values like 5.3 are called NUMERICS
- Numbers like 4 are called INTEGERS which are also categorized as numeric values.
- Boolean data types include [TRUE, FALSE] and are called LOGICAL Data Types
- String /Text data types are called CHARACTERS. E.g “Father”
The difference between Python an R when assigning variables is while Python uses “=”, R uses either “<-“ or “=” as shown below. When using characters or strings, ensure they are in quotation marks as seen below.
While in python you do print (Variable name), all you need to get the result of your assignment is to call the assigned word.
We have discussed the kind of data types available, we have also discussed how to assign values to variables. Let’s talk briefly about how to check the data type to which you have assigned to a variable.
Simply type class(variable_name) as seen below. This is all we would be going over today. Next week we would be covering Vectors and a little bit of Matrix.
P:S – To run your code, Use Control + Enter on your Keyboard.
To clear your console (where results are displayed), use Control + L
I hope you found this post helpful. If you have questions before then, please reach out to me on Seyitan.awojobi@gmail.com. I would be happy to help.
What are your major concerns with R as a programming language? Please share with us below.
Written By: Oluwaseyitan Awojobi.