praise()Error in `praise()`:
! could not find function "praise"
Motivating scenario: You have heard of or seen a cool way of doing things in R, but it requires functions that do not come with the standard “out of the box” R you have.
Learning goals: By the end of this sub-chapter you should be able to
install.packages() function.
library() function.

While R has many built-in functions, packages extend R’s capabilities by providing even more functions! Packages can offer better ways to do things in R, and can even enable you to do things that are not included in base R at all. In fact, R packages are a major way that the latest statistical and computational methods in various fields are shared with users.
Throughout this course we will run into many remarkably useful packages, including ggplot2 to make great plots, readr to load data, and dplyr to handle data.
Today, we’ll start with the two packages which I find better for a first lesson, praise and conflicted.
praise is a fun package. It is just here to provide us some encouragement. Its main function, praise(), provides words of support. This may seem silly, but learning R can be frustrating at first, and a little encouragement can help.
conflicted is one of my favorite packages. It addresses a problem that packages themselves create: different packages can contain functions with the same name. By default, R quietly chooses one of them, which can lead to confusing behavior.
When conflicted is loaded, R will instead, stop and ask you to be explicit whenever there is a name conflict, reminding you how to specify which function you want using package::function().
conflicted also provides the conflict_prefer() function, which allows you to tell R which version of a function you prefer. We will return to this useful idea in a later chapter.
Today we will install and load both packages, but only directly use praise. We simply load conflicted to get in the habit of using it every time we use R.
To install a package type, install.packages("<NAME OF PACKAGE>"). So to install these packages go to the console and type:
install.packages("conflicted")
install.packages("praise")
REMEMBER: You only need to install a package once!
So you installed your package. You feel like a hero. Now you try to use a function from it, but get this weird error:
praise()Error in `praise()`:
! could not find function "praise"
What went wrong?
Installing a package means that it is available for your computer, but to use a function in a package you need to tell R to make the package available. Use the library() function to make the functions in the package available, (e.g. library(conflicted) or library(praise)). Now it will work!
library(praise)
praise()[1] "You are neat!"
REMEMBER: You must load a package each R session that you will use it.