From the course: R for Data Science: Lunch Break Lessons

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

R data types: Vector

R data types: Vector

- [Instructor] When you're programming in R, there are several data structures that you should be aware of. Vector, list, matrices, arrays, data frames, and factors. Let's talk about vectors. It's the simplest form of data storage in R. And it looks like this, I.am.a.vector, and then into that, we'll assign a number, say one. And you can see over here in the global environment, that I.am.a.vector contains one, very, very simple. Now, the problem is that vectors are actually closer to arrays. And be aware that arrays are also used in R language, so right now we're just going to call 'em an array because it contains multiple numbers. So, we can do this. I... And assign into that, concatenate, one... So now you can see over here in the global environment that I.am.a.vector contains three numbers, one, two, three, and that's called a number here. I can also assign strings into a vector. And put into it, a concatenation of... and there's a line from Jabberwocky, and you can see that…

Contents