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.

library and require

library and require

- [Instructor] When you use a package with R, you have to install it, but then you use the library command to make it available to your code. There are a couple of options for library that we should talk about briefly. They'll make your life a little bit easier. In line three, I've printed out library, parentheses, fun. And this is typically how you'll use library. You name the package and you hit run and there's a library and now it's installed. In line four, I've added verbose equals true. So watch what happens when I run this command and down in the lower left in the console, you'll see that I've received a warning message, which says that package fun is already present. All verbose does is give us a bit more information about what happened during the library command, and you can turn it off just like I've shown in line five with verbose equals false. Now, if you're ever curious about how a particular package works…

Contents