packagefinder 패키지

패키지는 오픈소스 언어인 R을 더욱 강력하게 만들어줍니다. 전세계 수많은 개발자들에 의해 The Comprehensive R Archive Network (CRAN) 또는 Github을 통해 배포되는 다양한 패키지들이 없었더라면, 얼마나 많은 삽질을시간을 허비하고 있었을지 감히 상상할수 조차 없습니다. R의 패키지 시스템에 대한 소개는 다음글에 잘 설명되어 있습니다.

기본적으로 available.packages()을 사용하면 CRAN에 등록되어 있는 다양한 패키지를 확인 할 수 있습니다. 저같은 경우에 필요한 패키지가 있는 경우 google에 “XXX analysis in R” 또는 “XXX analysis R package” 등으로 검색을 하고 CRAN에 등록되어 있는 메뉴얼파일을 검토하는 방식으로 필요한 패키지를 찾아서 인스톨 하곤 했는데, 이를 R console 내에서 검색할 수 있는 패키지가 있습니다. 바로 “packagefinder”!!. 참고로 바로 어제(2018/07/05) CRAN에 등록된 따끈따끈한 놈입니다.

패키지를 인스톨하고 실행합니다. 패키지 개발자는 Joachim Zuckarelli입니다.

library(packagefinder)
library(magrittr) # for using a pipe

먼저 패키지를 찾는 findPackage() 함수를 알아보겠습니다. 검색되는게 많은데 head()함수를 이용해 20개만 보도록 하겠습니다.

findPackage(keywords = "regression") %>% head(20)
##
##  1253  out of  12737  CRAN packages found in 11 seconds.
SCORE NAME DESC_SHORT DOWNL_TOTAL GO
100.0 KoulMde Koul’s Minimum Distance Estimation in Linear Regression and Autoregression Model by Coordinate Descent Algorithm NA 5508
83.3 rrpack Reduced-Rank Regression NA 9912
75.0 GLDreg Fit GLD Regression Model and GLD Quantile Regression Model to Empirical Data NA 4235
75.0 reportReg An Easy Way to Report Regression Analysis NA 9328
75.0 rms Regression Modeling Strategies NA 9634
66.7 chngpt Estimation and Hypothesis Testing for Threshold Regression NA 1459
66.7 MultiRR Bias, Precision, and Power for Multi-Level Random Regressions NA 6953
58.3 BivRegBLS Tolerance Intervals and Errors-in-Variables Regressions in Method Comparison Studies NA 956
58.3 censCov Linear Regression with a Randomly Censored Covariate NA 1379
58.3 mcr Method Comparison Regression NA 6238
58.3 mixtools Tools for Analyzing Finite Mixture Models NA 6575
58.3 riskRegression Risk Regression Models and Prediction Scores for Survival Analysis with Competing Risks NA 9511
58.3 rminer Data Mining Classification and Regression Methods NA 9617
58.3 VIF VIF Regression: A Fast Regression Algorithm For Large Data NA 12324
50.0 acepack ACE and AVAS for Selecting Multiple Regression Transformations NA 38
50.0 cosso Fit Regularized Nonparametric Regression Models Using COSSO Penalty NA 1908
50.0 dblr Discrete Boosting Logistic Regression NA 2248
50.0 gcdnet LASSO and Elastic Net (Adaptive) Penalized Least Squares, Logistic Regression, HHSVM, Squared Hinge SVM and Expectile Regression using a Fast GCD Algorithm NA 3912
50.0 logistf Firth’s Bias-Reduced Logistic Regression NA 5872
50.0 lrmest Different Types of Estimators to Deal with Multicollinearity NA 5940

회귀와 관련된 패키지를 모두 찾을 수 있습니다. 관련도 순으로 점수가 나오고, 간단한 설명이 표시됩니다. mode = 옵션을 이용하면 검색할 때 “and” 또는 “or”을 이용할 수 있습니다.

findPackage(c("text", "tables"), mode="and") %>% head(20)
##
##  23  out of  12737  CRAN packages found in 11 seconds.
SCORE NAME DESC_SHORT DOWNL_TOTAL GO
100.0 pivottabler Create Pivot Tables in R NA 8114
100.0 textTinyR Text Processing for Small or Big Data Files NA 11713
71.4 htmlTable Advanced Tables for Markdown/HTML NA 4810
71.4 huxtable Easily Create and Style Tables for LaTeX, HTML and Other Formats NA 4840
71.4 RcmdrPlugin.temis Graphical Integrated Text Mining Solution NA 9042
57.1 highlightHTML Highlight HTML Text and Tables NA 4708
57.1 interlineaR Importing Interlinearized Corpora and Dictionaries as Produced by Descriptive Linguistics Software NA 5151
57.1 pointblank Validation of Local and Remote Data Tables NA 8234
57.1 rtf Rich Text Format (RTF) Output NA 10031
57.1 stargazer Well-Formatted Regression and Summary Statistics Tables NA 11236
42.9 commonmark High Performance CommonMark and Github Markdown Rendering in R NA 1735
42.9 descr Descriptive Statistics NA 2374
42.9 lexicon Lexicons for Text Analysis NA 5700
42.9 tables Formula-Driven Table Generation NA 11579
28.6 astrodatR Astronomical Data NA 445
28.6 biolink Create Hyperlinks to Biological Databases and Resources NA 916
28.6 cleanNLP A Tidy Data Model for Natural Language Processing NA 1537
28.6 compareGroups Descriptive Analysis by Groups NA 1747
28.6 datapasta R Tools for Data Copy-Pasta NA 2209
28.6 HoRM Supplemental Functions and Datasets for “Handbook of Regression Methods” NA 4776

go() function을 이용해 패키지에 대한 정보를 얻을 수 있는데. where.to = option을 이용해 PDF메뉴얼을 바로 불러 올 수도 있고(go("ggplot2",where.to="manual"), 설치를 할 수도 있습니다(go("ggplot2",where.to="install"). 개인적으로 메뉴얼을 R console에서 바로 볼 수 있는 기능이 편리한 것 같습니다.

또한 buildIndex() function을 이용해 리스트 방식으로 정리할수도 있습니다.

searchindex <- buildIndex()
findPackage(keywords=c("regression", "linear"), index=searchindex,
            mode="and", always.sensitive="GLM")

만들어진 리스트에서 패키지 이름을 확인해볼까요.

searchindex$index$NAME %>% head(100)
##   [1] "A3"                 "abbyyR"             "abc"
##   [4] "abc.data"           "ABC.RAP"            "ABCanalysis"
##   [7] "abcdeFBA"           "ABCoptim"           "ABCp2"
##  [10] "abcrf"              "abctools"           "abd"
##  [13] "abe"                "abf2"               "ABHgenotypeR"
##  [16] "abind"              "abjutils"           "abn"
##  [19] "abnormality"        "abodOutlier"        "ABPS"
##  [22] "AbsFilterGSEA"      "AbSim"              "abundant"
##  [25] "Ac3net"             "ACA"                "acc"
##  [28] "accelerometry"      "accelmissing"       "AcceptanceSampling"
##  [31] "ACCLMA"             "accrual"            "accrued"
##  [34] "accSDA"             "ACD"                "ACDm"
##  [37] "acebayes"           "acepack"            "ACEt"
##  [40] "acid"               "acm4r"              "ACMEeqtl"
##  [43] "acmeR"              "ACNE"               "acnr"
##  [46] "acopula"            "AcousticNDLCodeR"   "acp"
##  [49] "aCRM"               "AcrossTic"          "acrt"
##  [52] "acs"                "ACSNMineR"          "acss"
##  [55] "acss.data"          "ACSWR"              "ACTCD"
##  [58] "Actigraphy"         "ActiveDriver"       "activity"
##  [61] "activpalProcessing" "actogrammr"         "actuar"
##  [64] "AcuityView"         "ada"                "adabag"
##  [67] "adagio"             "AdapEnetClass"      "adapr"
##  [70] "AdapSamp"           "adaptalint"         "AdaptFit"
##  [73] "AdaptFitOS"         "AdaptGauss"         "adaptiveGPCA"
##  [76] "adaptivetau"        "adaptMCMC"          "adaptsmoFMRI"
##  [79] "adaptTest"          "AdaSampling"        "ADCT"
##  [82] "addhaz"             "addhazard"          "addinslist"
##  [85] "additiveDEA"        "additivityTests"    "addreg"
##  [88] "ADDT"               "ade4"               "ade4TkGUI"
##  [91] "adeba"              "adegenet"           "adegraphics"
##  [94] "adehabitatHR"       "adehabitatHS"       "adehabitatLT"
##  [97] "adehabitatMA"       "adephylo"           "adepro"
## [100] "AdequacyModel"

https://crantastic.org/packages 를 통해 패키지를 확인하는 것도 좋은 방법입니다. 이곳에는 각 패키지들의 점수와 리뷰까지 확인해 볼 수 있습니다.