DataCamp and R Basics

The Data Science Journey Begins

I started playing around with R and I’ve got some things to share so let’s get into it.

Like I mentioned in my previous post I’m currently using DataCamp to learn the basics of R. It is a platform a lot like Codecademy but focused on Python, R, and data science concepts. I think the interactive editor and bright colors help keep me focused. They also have premium courses that includes a wealth of topics and added content like engaging videos to liven things up for \$25 a month. If you’re curious give it a go and let me know what you think.

On to R itself. In comparison to the times I played around with other languages, it feels like a “thinking” language; It is logical, deliberate, and organized. I guess it makes sense for a language focused on statistical analysis. Here’s what some of the basics look like:

`my_variable <- "Giants" #String`
`my_boolean <- TRUE #logical, in R can be shortened to Tmy_oranges <- 6   #numeric assignmentmy_apples <- 5my_fruit <- my_apples + my_oranges`
`my_fruit  #Typing a variable into you editor prints the value inside. In this case  11`

We’re not breaking any new ground here but we all begin somewhere. We can store numbers and strings in variables to use later. Even perform basic arithmetic. But what if you want to store more than one thing in a variable? Enter:

Vectors

If you’re familiar with arrays this is very similar. You can store variables, numerics, and logicals in it. However, you can’t mix and match them(boo) so for example:

`c()   #the combine function, makes the vectorc(1, 2, 3)c("Wonder Woman", "Batman", "Superman")c(TRUE, FALSE, T, T)c(F, "Jessica", 4.2) #This causes an error`

Perhaps R has an answer for storing mixed data types. Time will tell. Next week I’ll go a little deeper into vectors and show you how you can use them for basic analysis (Finally!) The first step has been made!

If you learned something and or enjoyed this, hit the recommend button.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.