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.

combine

combine

- [Instructor] C or combined values is the most commonly used function. It seems silly to spend time talking about it, but there are a couple of behaviors that could cause you problem, so let's look at c behaves when you combine different types. In the upper left hand corner I've created several vectors. intThing, floatThing, factorThing, and all of this is in the example files, the important thing is if you look in the upper right hand corner, in the global environment, you'll see the results of those commands. So I've got an array, and a characterThing, and a factorThing. Let's go down to the console, on the lower left hand corner, and mix a couple of those using c. So here's mixedThing, and into mixedThing I'm going to combine a characterThing, and an intThing. so characterThing is obviously a bunch of characters and int is a bunch of integers. And if we hit the returned, which runs this command, then I get mixedThing, and if you look on the right hand side, it says mixedThing is a…

Contents