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

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Use print() for more than you do now

Use print() for more than you do now

- [Instructor] You have used print hundreds of times so how can there be anything else left to learn about it? Well, actually, there is something to learn about print and you can improve how it prints things out for you. Let's take a look at some of the changes you can make to the print statement to improve how it represents your information. First of all, start with a simple. Print parentheses quote hello. How boring but we can change that and tell it not to include the quotes. How about this? Quote equals FALSE. And now we get the value without the quote marks in it but wait, there's more. How does it deal with factors? Well, to do that, we'll need a factor to start off with so let's create myfactor and into that we're going to place as.factor. The defined variable letters. Now, if I type in myfactor and look at the contents of it, you'll see that I get not only contents of myfactor but it also tells me that the…

Contents