I know … I know … its been a while. I am busy with my online classes what can I do?
Lets get back to the topic.
What type of stuff is in R that you can work with ? Well … there are plenty.
I am definitely not going to go into details because it would make this post probably the longest post of the history of posts. Before you go read more, let me share you the one thing you always have to keep in mind.
Everything in R is an object.
R has five basic or dare I say “atomic” classes of objects.
- logical (TRUE/FALSE)
If they sound too confusing, lets clear your mind. The character type is your “abCD” etc etc. Integers are your numbers 1 2 3 4 and so on. Logical is TRUE or FALSE and that is all there is to it. Numeric is a number with a decimal point. That is how it differentiates from integer. Complex is something like 2+5i …
Couple of key things that I want to point out to you. Numbers are generally treated as double precision real numbers. If you want an integer specifically, you have to specify the L suffix. If you enter 1, that is an object but if you enter 1L, that is an integer. Try it out.
In R, there is a NaN value. It is not necessarily a type – if you do class(NaN) you get numeric – but it is special. It represents an undefined value and it can also be thought as a missing value.
> 0 / 0
See what I mean?
Another one is Inf which represents infinity. Just do 1 / Inf to see it for your self. Reading here is one thing but doing it your self is another.
Now this is all good but we can not examine millions of rows of data just with what I listed above now can we ? We need some sort of operators that help us organize our data and do math on it. The most basic operator is a vector but of course there are more.
- Vectors (most common one)
- Data Frames
I am not going to talk about them here because they deserve their individual topics. Yes with an “s” at the end. You are going to use them and abuse them. It is best if you start researching now.