Module 15 ยท How do you install the CNA package?
Adding CNA's tools to R
By the end of this module you will be able to
- Install the cna package once.
- Load it at the start of every session.
- Explain the install-once, library-every-time pattern.
R doesn't know how to do Coincidence Analysis straight out of the box. You teach it by installing the cna package, a free add-on published on CRAN, the official R software library. You install it once, then load it at the start of every session.
Console, run once, ever
# download and install the cna package (needs internet, do this once) install.packages("cna")
Console, run every new session
# switch the tools on for this session library(cna)
The pattern to memorise
Install once. Library every time.
install.packages() is like buying a tool and putting it in the cupboard. You do it once. library() is taking the tool back out of the cupboard, which you do at the start of every session. Forgetting library(cna) is the single most common beginner stumble, and now it won't be yours.
Reflect
Lock in the habit now.
- Why does install.packages() happen once but library(cna) every time?
- What is the most common reason a CNA script fails on the first line?