728x90

R 에는 20,000 개가 넘는 패키지가 있으며, 이 패키지는 수많은 통계학자와 프로그래머들이 계속 개발하고 배포하고 있습니다. 이렇게 많은 패키지들을 전부 살펴 보는 것은 거의 불가능하지만 나의 PC에 어떤 패키지들이 설치되어 있는지를 살펴보는 것은 필요합니다. 

### 1. 설치되어 있는 패키지 목록보기 – library( ) 

R을 다운로드하여 설치하면 2만 여개가 넘는 R 패키지 중에서 기본적으로 30 여개 정도의 패키지가 설치됩니다. 그리고 새로운 패키지를 추가 설치하려면, 필요할 때마다 불러와서 PC에 설치하면 됩니다. (install.packages 명령). 나의 PC에 설치된 패키지들의 목록을 살펴보는 명령문이 바로 library( ) 함수입니다.

\> library()  또는 installed.packages()    

  <img src='https://wikidocs.net/images/page/6145/r_pac_lib_01.jpg' style="width:600px; height:400px; border: 2px solid black;">   
  
현재 나의 PC에서 설치되어 있는 R은 ‘C:/R/R-4.0.1/library 에 설치되어 있는 것을 볼 수 있습니다. 설치된 R 버전에 따라 다른 위치에 있게 됩니다.
```
패키지 명               설     명
base                   The R Base Package
boot                   Bootstrap Functions (originally by Angelo
                       Canty for S)
class                  Functions for Classification
cluster                Cluster Analysis Extended Rousseeuw et al.
codetools              Code Analysis Tools for R
compiler               The R Compiler Package
datasets               The R Datasets Package
foreign                Read Data Stored by Minitab, S, SAS, SPSS,
                       Stata, Systat, dBase, ...
graphics               The R Graphics Package
grDevices              The R Graphics Devices and Support for
                       Colours and Fonts
grid                   The Grid Graphics Package
KernSmooth             Functions for kernel smoothing for Wand &
                       Jones (1995)
lattice                Lattice Graphics
MASS                   Support Functions and Datasets for Venables
                       and Ripley's MASS
Matrix                 Sparse and Dense Matrix Classes and Methods
methods                Formal Methods and Classes
mgcv                   Mixed GAM Computation Vehicle with
                       GCV/AIC/REML smoothness estimation
nlme                   Linear and Nonlinear Mixed Effects Models
nnet                   Feed-forward Neural Networks and Multinomial
                       Log-Linear Models
parallel               Support for Parallel computation in R
rpart                  Recursive Partitioning
spatial                Functions for Kriging and Point Pattern
                       Analysis
splines                Regression Spline Functions and Classes
stats                  The R Stats Package
stats4                 Statistical Functions using S4 Classes
survival               Survival analysis, including penalised
                       likelihood.
tcltk                  Tcl/Tk Interface
tools                  Tools for Package Development
utils                  The R Utils Package
```
패키지는 R 시스템이 설치되어 있는 폴더 내에 \library 폴더가 있는데 그 아래에 패키지 이름으로 된 하부 폴더가 물리적으로 존재합니다.
 

+ Recent posts