search()
wants <- c("coin", "remotes")
has <- wants %in% rownames(installed.packages())
if(any(!has)) install.packages(wants[!has])
Error in install.packages(wants[!has]): unable to install packages
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
[3] "/usr/lib/R/library"
[1] "/usr/local/lib/R/site-library/coin"
Show first 10 of all installed packages
[1] "abind" "AICcmodavg" "askpass" "assertthat" "backports"
[6] "base64enc" "bayestestR" "beeswarm" "BH" "bit"
Install from CRAN
setRepositories("https://cloud.r-project.org/")
install.packages(c("coin", "car"))
install.packages("coin", repos="https://cran.at.r-project.org/")
update.packages()
# remove.packages("coin")
# not shown
Install from GitHub repository (note: no quality control)
help(package="coin")
vignette()
vignette(package="coin")
vignette("coin_implementation")
# not shown (opens separate window)
library()
throws an error if the package cannot be found, unless option logical.return=TRUE
is set.
Get a return value TRUE
or FALSE
that indicates whether package could be loaded
[1] FALSE
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] coin_1.3-1 survival_3.2-7 stringr_1.4.0 knitr_1.30
loaded via a namespace (and not attached):
[1] codetools_0.2-16 lattice_0.20-41 matrixStats_0.57.0 mvtnorm_1.1-1
[5] zoo_1.8-8 MASS_7.3-51.5 grid_3.6.3 stats4_3.6.3
[9] magrittr_2.0.1 evaluate_0.14 stringi_1.5.3 multcomp_1.4-15
[13] Matrix_1.2-18 sandwich_3.0-0 TH.data_1.0-10 splines_3.6.3
[17] tools_3.6.3 xfun_0.19 parallel_3.6.3 compiler_3.6.3
[21] libcoin_1.0-6 modeltools_0.2-23
[1] ".GlobalEnv" "package:coin" "package:survival"
[4] "package:stringr" "package:knitr" "package:stats"
[7] "package:graphics" "package:grDevices" "package:utils"
[10] "package:datasets" "package:methods" "Autoloads"
[13] "package:base"
If different packages provide functions with the same name, the function from the package loaded later masks the function from the package loaded earlier. Check if this happened:
$.GlobalEnv
[1] "args"
$`package:coin`
[1] "confint" "initialize" "show"
$`package:stats`
[1] "confint"
$`package:methods`
[1] "initialize" "show" "body<-" "kronecker"
$`package:base`
[1] "args" "body<-" "kronecker"
Prevent masking - make conflicts an error when running library()
Explicitly state which package a function should be taken from.
[1] 2.666667
Error in detach(package:remotes) : invalid 'name' argument
R markdown - markdown - R code - all posts