-1

I installed swirl package in R studio console and I started learning R programming. After completing a chapter I closed R studio. I didn't save the workspace while quitting the R studio.

After a day I started R-Studio again and ran swirl() command in the console. The R-Studio gave this error - "Error: could not find function "swirl""

Do I need to install the package everytime in R studio? Doesnt it store in R ? Pls help.

www
  • 38,575
  • 12
  • 48
  • 84
Rohit A
  • 31
  • 4
  • 2
    you install them once with `install.packages("pkg")`, but at every new session you need to load them with `library("pkg")` – baptiste Jan 14 '15 at 17:54
  • 1
    No, but you have to call `library(swirl)` or `require(swirl)` to load the package whenever you start a fresh session. – nrussell Jan 14 '15 at 17:54
  • 2
    Open up RStudio, type `RShowDoc("R-intro")`, press return, and then read chapter 13 of the pdf document that it opens up. – Josh O'Brien Jan 14 '15 at 17:54

1 Answers1

2

you should first type the command library (swirl). That will load the library in the namespace and allow you to use its functions.

user1357015
  • 11,168
  • 22
  • 66
  • 111