Note that packages must be installed only once (until you update your R, then you have to install them again), whereas packages must be loaded every time you open R. To load a package, run library(name_of_package) (this time "" around the name of the package are optional, but can still be used if you wish). Once the package is installed, you must load the package and only after it has been loaded you can use all the functions and datasets it contains. In order to use a package, it needs to be installed on your computer by running install.packages("name_of_package") (do not forget "" around the name of the package, otherwise R will look for an object saved under that name!). R is open source so everyone can write code and publish it as a package, and everyone can install a package and start using the functions or datasets built inside the package, all this for free. Packages extend existing base R functionalities by adding new ones. These extensions which are are collections of functions and datasets developed and published by R users are called packages. You will thus often need to install some “extensions” to perform the analyses you want. Unlike other programs, only fundamental functionalities come by default with R.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |