filmov
tv
Installing and loading R packages
![preview_player](https://i.ytimg.com/vi/RECmgnnV_N4/maxresdefault.jpg)
Показать описание
Installing and loading R packages
Users can download, install, and update packages from
the repositories.
R allows users to create their own packages, official and non-official
repositories are provided to manage these user-created packages.
CRAN is the official R package repository
CRAN is a network of FTP and web servers around the world that store identical, up-to-date versions of code and documentation for R. You may select the closest CRAN mirror to your location to download packages.
To load a list of installed packages:
- library()
Setting the default CRAN mirror:
- chooseCRANmirror()
Install a package from CRAN; take package e1071 as an example:
Update a package from CRAN; take package e1071 as an example:
Load the package the package:
- library(e1071)
If you would like to view the documentation of the package, you can use the help function:
- help(package ="e1071")
If you would like to view the documentation of the function, you can use the help function:
- help(svm, e1071)
To view the argument taken for the function, simply use the args function. For example, if you would like to know the argument taken for the lm function:
- args(lm)
Some packages will provide examples and demos; you can use example or demo to view an example or demo. For example, one can view an example of the lm package and a demo of the graphics package by typing the following commands:
- example(lm)
- demo(graphics)
Users can download, install, and update packages from
the repositories.
R allows users to create their own packages, official and non-official
repositories are provided to manage these user-created packages.
CRAN is the official R package repository
CRAN is a network of FTP and web servers around the world that store identical, up-to-date versions of code and documentation for R. You may select the closest CRAN mirror to your location to download packages.
To load a list of installed packages:
- library()
Setting the default CRAN mirror:
- chooseCRANmirror()
Install a package from CRAN; take package e1071 as an example:
Update a package from CRAN; take package e1071 as an example:
Load the package the package:
- library(e1071)
If you would like to view the documentation of the package, you can use the help function:
- help(package ="e1071")
If you would like to view the documentation of the function, you can use the help function:
- help(svm, e1071)
To view the argument taken for the function, simply use the args function. For example, if you would like to know the argument taken for the lm function:
- args(lm)
Some packages will provide examples and demos; you can use example or demo to view an example or demo. For example, one can view an example of the lm package and a demo of the graphics package by typing the following commands:
- example(lm)
- demo(graphics)
Комментарии