我已根据此页面将R安装到我的VM(Ubuntu 14.04)中,
http://www.rstudio.com/shiny/server/install-opensource
我还从R控制台安装了shiny
,如下所示。
# R
R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> install.packages('shiny', verbose = TRUE)
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
system (cmd0): /usr/lib/R/bin/R CMD INSTALL
also installing the dependencies ‘Rcpp’, ‘bitops’, ‘httpuv’, ‘caTools’, ‘RJSONIO’, ‘xtable’, ‘digest’
trying URL 'http://cran.md.tsukuba.ac.jp/src/contrib/Rcpp_0.11.1.tar.gz'
Content type 'application/x-gzip' length 2003515 bytes (1.9 Mb)
opened URL
==================================================
downloaded 1.9 Mb
trying URL 'http://cran.md.tsukuba.ac.jp/src/contrib/bitops_1.0-6.tar.gz'
Content type 'application/x-gzip' length 8734 bytes
opened URL
==================================================
downloaded 8734 bytes
trying URL 'http://cran.md.tsukuba.ac.jp/src/contrib/httpuv_1.3.0.tar.gz'
Content type 'application/x-gzip' length 423739 bytes (413 Kb)
opened URL
==================================================
downloaded 413 Kb
trying URL 'http://cran.md.tsukuba.ac.jp/src/contrib/caTools_1.17.tar.gz'
Content type 'application/x-gzip' length 63326 bytes (61 Kb)
opened URL
==================================================
downloaded 61 Kb
trying URL 'http://cran.md.tsukuba.ac.jp/src/contrib/RJSONIO_1.2-0.2.tar.gz'
Content type 'application/x-gzip' length 1180440 bytes (1.1 Mb)
opened URL
==================================================
downloaded 1.1 Mb
trying URL 'http://cran.md.tsukuba.ac.jp/src/contrib/xtable_1.7-3.tar.gz'
Content type 'application/x-gzip' length 357303 bytes (348 Kb)
opened URL
==================================================
downloaded 348 Kb
trying URL 'http://cran.md.tsukuba.ac.jp/src/contrib/digest_0.6.4.tar.gz'
Content type 'application/x-gzip' length 79309 bytes (77 Kb)
opened URL
==================================================
downloaded 77 Kb
trying URL 'http://cran.md.tsukuba.ac.jp/src/contrib/shiny_0.9.1.tar.gz'
Content type 'application/x-gzip' length 958658 bytes (936 Kb)
opened URL
==================================================
downloaded 936 Kb
foundpkgs: Rcpp, bitops, httpuv, caTools, RJSONIO, xtable, digest, shiny, /tmp/RtmpaUauPs/downloaded_packages/Rcpp_0.11.1.tar.gz, /tmp/RtmpaUauPs/downloaded_packages/bitops_1.0-6.tar.gz, /tmp/RtmpaUauPs/downloaded_packages/httpuv_1.3.0.tar.gz, /tmp/RtmpaUauPs/downloaded_packages/caTools_1.17.tar.gz, /tmp/RtmpaUauPs/downloaded_packages/RJSONIO_1.2-0.2.tar.gz, /tmp/RtmpaUauPs/downloaded_packages/xtable_1.7-3.tar.gz, /tmp/RtmpaUauPs/downloaded_packages/digest_0.6.4.tar.gz, /tmp/RtmpaUauPs/downloaded_packages/shiny_0.9.1.tar.gz
files: /tmp/RtmpaUauPs/downloaded_packages/Rcpp_0.11.1.tar.gz,
/tmp/RtmpaUauPs/downloaded_packages/bitops_1.0-6.tar.gz,
/tmp/RtmpaUauPs/downloaded_packages/httpuv_1.3.0.tar.gz,
/tmp/RtmpaUauPs/downloaded_packages/caTools_1.17.tar.gz,
/tmp/RtmpaUauPs/downloaded_packages/RJSONIO_1.2-0.2.tar.gz,
/tmp/RtmpaUauPs/downloaded_packages/xtable_1.7-3.tar.gz,
/tmp/RtmpaUauPs/downloaded_packages/digest_0.6.4.tar.gz,
/tmp/RtmpaUauPs/downloaded_packages/shiny_0.9.1.tar.gz
1): succeeded '/usr/lib/R/bin/R CMD INSTALL -l '/usr/local/lib/R/site-library' /tmp/RtmpaUauPs/downloaded_packages/Rcpp_0.11.1.tar.gz'
2): succeeded '/usr/lib/R/bin/R CMD INSTALL -l '/usr/local/lib/R/site-library' /tmp/RtmpaUauPs/downloaded_packages/bitops_1.0-6.tar.gz'
3): succeeded '/usr/lib/R/bin/R CMD INSTALL -l '/usr/local/lib/R/site-library' /tmp/RtmpaUauPs/downloaded_packages/RJSONIO_1.2-0.2.tar.gz'
4): succeeded '/usr/lib/R/bin/R CMD INSTALL -l '/usr/local/lib/R/site-library' /tmp/RtmpaUauPs/downloaded_packages/xtable_1.7-3.tar.gz'
5): succeeded '/usr/lib/R/bin/R CMD INSTALL -l '/usr/local/lib/R/site-library' /tmp/RtmpaUauPs/downloaded_packages/digest_0.6.4.tar.gz'
6): succeeded '/usr/lib/R/bin/R CMD INSTALL -l '/usr/local/lib/R/site-library' /tmp/RtmpaUauPs/downloaded_packages/httpuv_1.3.0.tar.gz'
7): succeeded '/usr/lib/R/bin/R CMD INSTALL -l '/usr/local/lib/R/site-library' /tmp/RtmpaUauPs/downloaded_packages/caTools_1.17.tar.gz'
8): succeeded '/usr/lib/R/bin/R CMD INSTALL -l '/usr/local/lib/R/site-library' /tmp/RtmpaUauPs/downloaded_packages/shiny_0.9.1.tar.gz'
The downloaded source packages are in
‘/tmp/RtmpaUauPs/downloaded_packages’
根据建议(见jdharrison和scottkosty的评论),
我的输出有debug(install.packages)
。
以下是最后几十行(我已适当省略)。
> debug(install.packages)
> install.packages("shiny")
(snip because of very long outputs)
Browse[2]>
debug: if (status > 0L) warning(gettextf("installation of package %s had non-zero exit status",
sQuote(update[i, 1L])), domain = NA) else if (verbose) {
cmd <- paste(c(cmd0, args), collapse = " ")
message(sprintf("%d): succeeded '%s'", i, cmd), domain = NA)
}
Browse[2]>
debug: if (verbose) {
cmd <- paste(c(cmd0, args), collapse = " ")
message(sprintf("%d): succeeded '%s'", i, cmd), domain = NA)
}
Browse[2]>
debug: outfile <- if (keep_outputs) {
paste0(update[i, 1L], ".out")
} else output
Browse[2]>
debug: output
Browse[2]>
debug: args <- c(args0, get_install_opts(update[i, 3L]), "-l", shQuote(update[i,
2L]), getConfigureArgs(update[i, 3L]), getConfigureVars(update[i,
3L]), update[i, 3L])
Browse[2]>
debug: status <- system2(cmd0, args, env = env, stdout = outfile, stderr = outfile)
Browse[2]>
debug: if (!quiet && keep_outputs) writeLines(readLines(outfile))
Browse[2]>
debug: if (status > 0L) warning(gettextf("installation of package %s had non-zero exit status",
sQuote(update[i, 1L])), domain = NA) else if (verbose) {
cmd <- paste(c(cmd0, args), collapse = " ")
message(sprintf("%d): succeeded '%s'", i, cmd), domain = NA)
}
Browse[2]>
debug: if (verbose) {
cmd <- paste(c(cmd0, args), collapse = " ")
message(sprintf("%d): succeeded '%s'", i, cmd), domain = NA)
}
Browse[2]>
debug: outfile <- if (keep_outputs) {
paste0(update[i, 1L], ".out")
} else output
Browse[2]>
debug: output
Browse[2]>
debug: args <- c(args0, get_install_opts(update[i, 3L]), "-l", shQuote(update[i,
2L]), getConfigureArgs(update[i, 3L]), getConfigureVars(update[i,
3L]), update[i, 3L])
Browse[2]>
debug: status <- system2(cmd0, args, env = env, stdout = outfile, stderr = outfile)
Browse[2]>
debug: if (!quiet && keep_outputs) writeLines(readLines(outfile))
Browse[2]>
debug: if (status > 0L) warning(gettextf("installation of package %s had non-zero exit status",
sQuote(update[i, 1L])), domain = NA) else if (verbose) {
cmd <- paste(c(cmd0, args), collapse = " ")
message(sprintf("%d): succeeded '%s'", i, cmd), domain = NA)
}
Browse[2]>
debug: if (verbose) {
cmd <- paste(c(cmd0, args), collapse = " ")
message(sprintf("%d): succeeded '%s'", i, cmd), domain = NA)
}
Browse[2]>
debug: if (keep_outputs && (outdir != getwd())) file.copy(paste0(update[,
1L], ".out"), outdir)
Browse[2]>
debug: if (!quiet && nonlocalrepos && !is.null(tmpd) && is.null(destdir)) cat("\n",
gettextf("The downloaded source packages are in\n\t%s", sQuote(normalizePath(tmpd,
mustWork = FALSE))), "\n", sep = "")
Browse[2]>
debug: cat("\n", gettextf("The downloaded source packages are in\n\t%s",
sQuote(normalizePath(tmpd, mustWork = FALSE))), "\n", sep = "")
Browse[2]>
The downloaded source packages are in
‘/tmp/RtmpaUauPs/downloaded_packages’
debug: libs_used <- unique(update[, 2L])
Browse[2]>
debug: if (.Platform$OS.type == "unix" && .Library %in% libs_used) {
message("Updating HTML index of packages in '.Library'")
make.packages.html(.Library)
}
Browse[2]>
debug: invisible()
Browse[2]>
exiting from: install.packages("shiny")
>
>
但我无法加载shiny
,因为它只是下载,而不是解压缩到/ usr / local / lib / R / site-library。
> library('shiny')
Error in library("shiny") : there is no package called ‘shiny’
>
> installed.packages()
Package LibPath Version Priority
base "base" "/usr/lib/R/library" "3.1.0" "base"
boot "boot" "/usr/lib/R/library" "1.3-11" "recommended"
class "class" "/usr/lib/R/library" "7.3-10" "recommended"
cluster "cluster" "/usr/lib/R/library" "1.15.2" "recommended"
codetools "codetools" "/usr/lib/R/library" "0.2-8" "recommended"
compiler "compiler" "/usr/lib/R/library" "3.1.0" "base"
datasets "datasets" "/usr/lib/R/library" "3.1.0" "base"
foreign "foreign" "/usr/lib/R/library" "0.8-61" "recommended"
graphics "graphics" "/usr/lib/R/library" "3.1.0" "base"
grDevices "grDevices" "/usr/lib/R/library" "3.1.0" "base"
grid "grid" "/usr/lib/R/library" "3.1.0" "base"
KernSmooth "KernSmooth" "/usr/lib/R/library" "2.23-12" "recommended"
lattice "lattice" "/usr/lib/R/library" "0.20-29" "recommended"
MASS "MASS" "/usr/lib/R/library" "7.3-33" "recommended"
Matrix "Matrix" "/usr/lib/R/library" "1.1-3" "recommended"
methods "methods" "/usr/lib/R/library" "3.1.0" "base"
mgcv "mgcv" "/usr/lib/R/library" "1.7-29" "recommended"
nlme "nlme" "/usr/lib/R/library" "3.1-117" "recommended"
nnet "nnet" "/usr/lib/R/library" "7.3-8" "recommended"
parallel "parallel" "/usr/lib/R/library" "3.1.0" "base"
rpart "rpart" "/usr/lib/R/library" "4.1-8" "recommended"
spatial "spatial" "/usr/lib/R/library" "7.3-7" "recommended"
splines "splines" "/usr/lib/R/library" "3.1.0" "base"
stats "stats" "/usr/lib/R/library" "3.1.0" "base"
stats4 "stats4" "/usr/lib/R/library" "3.1.0" "base"
survival "survival" "/usr/lib/R/library" "2.37-7" "recommended"
tcltk "tcltk" "/usr/lib/R/library" "3.1.0" "base"
tools "tools" "/usr/lib/R/library" "3.1.0" "base"
utils "utils" "/usr/lib/R/library" "3.1.0" "base"
Depends
base NA
boot "R (>= 3.0.0), graphics, stats"
class "R (>= 3.0.0), stats, utils"
cluster "R (>= 2.12.0), stats, utils"
codetools "R (>= 2.1)"
compiler NA
datasets NA
foreign "R (>= 3.0.0), stats"
graphics NA
grDevices NA
grid NA
KernSmooth "R (>= 2.5.0), stats"
lattice "R (>= 2.15.1)"
MASS "R (>= 3.0.0), grDevices, graphics, stats, utils"
Matrix "R (>= 2.15.2), methods"
methods NA
mgcv "R (>= 2.14.0), nlme (>= 3.1-64)"
nlme "graphics, stats, R (>= 3.0.0)"
nnet "R (>= 2.14.0), stats, utils"
parallel NA
rpart "R (>= 2.15.0), graphics, stats, grDevices"
spatial "R (>= 3.0.0), graphics, stats, utils"
splines NA
stats NA
stats4 NA
survival "stats, utils, graphics, splines, R (>= 2.13.0)"
tcltk NA
tools NA
utils NA
Imports LinkingTo
base NA NA
boot NA NA
class "MASS" NA
cluster "graphics, grDevices" NA
codetools NA NA
compiler NA NA
datasets NA NA
foreign "methods, utils" NA
graphics "grDevices" NA
grDevices NA NA
grid "grDevices" NA
KernSmooth NA NA
lattice "grid, grDevices, graphics, stats, utils" NA
MASS NA NA
Matrix "graphics, grid, stats, utils, lattice" NA
methods "utils" NA
mgcv "methods, stats, graphics, Matrix" NA
nlme "lattice" NA
nnet NA NA
parallel "tools" NA
rpart NA NA
spatial NA NA
splines "graphics, stats" NA
stats NA NA
stats4 "graphics, methods, stats" NA
survival NA NA
tcltk "utils" NA
tools NA NA
utils NA NA
Suggests
base NA
boot "MASS, survival"
class NA
cluster "MASS"
codetools NA
compiler NA
datasets NA
foreign NA
graphics NA
grDevices NA
grid "lattice"
KernSmooth "MASS"
lattice "KernSmooth, MASS"
MASS "lattice, nlme, nnet, survival"
Matrix "expm, MASS"
methods NA
mgcv "splines, parallel"
nlme "Hmisc, MASS"
nnet "MASS"
parallel NA
rpart "survival"
spatial "MASS"
splines NA
stats NA
stats4 NA
survival NA
tcltk NA
tools NA
utils NA
Enhances License
base NA "Part of R 3.1.0"
boot NA "Unlimited"
class NA "GPL-2 | GPL-3"
cluster NA "GPL (>= 2)"
codetools NA "GPL"
compiler NA "Part of R 3.1.0"
datasets NA "Part of R 3.1.0"
foreign NA "GPL (>= 2)"
graphics NA "Part of R 3.1.0"
grDevices NA "Part of R 3.1.0"
grid NA "Part of R 3.1.0"
KernSmooth NA "Unlimited"
lattice "chron" "GPL (>= 2)"
MASS NA "GPL-2 | GPL-3"
Matrix "MatrixModels, graph, SparseM, sfsmisc" "GPL (>= 2)"
methods NA "Part of R 3.1.0"
mgcv NA "GPL (>= 2)"
nlme NA "GPL (>= 2)"
nnet NA "GPL-2 | GPL-3"
parallel "snow, nws, Rmpi" "Part of R 3.1.0"
rpart NA "GPL-2 | GPL-3"
spatial NA "GPL-2 | GPL-3"
splines NA "Part of R 3.1.0"
stats NA "Part of R 3.1.0"
stats4 NA "Part of R 3.1.0"
survival NA "LGPL (>= 2)"
tcltk NA "Part of R 3.1.0"
tools NA "Part of R 3.1.0"
utils NA "Part of R 3.1.0"
License_is_FOSS License_restricts_use OS_type MD5sum
base NA NA NA NA
boot NA NA NA NA
class NA NA NA NA
cluster NA NA NA NA
codetools NA NA NA NA
compiler NA NA NA NA
datasets NA NA NA NA
foreign NA NA NA NA
graphics NA NA NA NA
grDevices NA NA NA NA
grid NA NA NA NA
KernSmooth NA NA NA NA
lattice NA NA NA NA
MASS NA NA NA NA
Matrix NA NA NA NA
methods NA NA NA NA
mgcv NA NA NA NA
nlme NA NA NA NA
nnet NA NA NA NA
parallel NA NA NA NA
rpart NA NA NA NA
spatial NA NA NA NA
splines NA NA NA NA
stats NA NA NA NA
stats4 NA NA NA NA
survival NA NA NA NA
tcltk NA NA NA NA
tools NA NA NA NA
utils NA NA NA NA
NeedsCompilation Built
base NA "3.1.0"
boot "no" "3.0.3"
class "yes" "3.0.3"
cluster "yes" "3.1.0"
codetools NA "3.0.3"
compiler NA "3.1.0"
datasets NA "3.1.0"
foreign "yes" "3.0.3"
graphics NA "3.1.0"
grDevices NA "3.1.0"
grid NA "3.1.0"
KernSmooth "yes" "3.0.3"
lattice "yes" "3.1.0"
MASS "yes" "3.1.0"
Matrix "yes" "3.1.0"
methods NA "3.1.0"
mgcv "yes" "3.1.0"
nlme "yes" "3.1.0"
nnet "yes" "3.1.0"
parallel NA "3.1.0"
rpart "yes" "3.0.3"
spatial "yes" "3.0.3"
splines NA "3.1.0"
stats NA "3.1.0"
stats4 NA "3.1.0"
survival "yes" "3.0.2"
tcltk NA "3.1.0"
tools NA "3.1.0"
utils NA "3.1.0"
如何拆开这些包?
# dpkg -l | grep r-base
ii libgcr-base-3-1:amd64 3.10.1-1 amd64 Library for Crypto related tasks
ii r-base 3.1.0-1trusty0 all GNU R statistical computation and graphics system
ii r-base-core 3.1.0-1trusty0 amd64 GNU R core of statistical computation and graphics system
ii r-base-dev 3.1.0-1trusty0 all GNU R installation of auxiliary GNU R packages
ii r-base-html 3.1.0-1trusty0 all GNU R html docs for statistical computing system functions
# cat /etc/R/Renviron
### etc/Renviron. Generated from Renviron.in by configure.
###
### ${R_HOME}/etc/Renviron
###
### Record R system environment variables.
R_PLATFORM=${R_PLATFORM-'x86_64-pc-linux-gnu'}
## Default printer paper size: first record if user set R_PAPERSIZE
R_PAPERSIZE_USER=${R_PAPERSIZE-'letter'}
R_PAPERSIZE=${R_PAPERSIZE-'letter'}
## Default print command
R_PRINTCMD=${R_PRINTCMD-'/usr/bin/lpr'}
# for Rd2pdf, reference manual
R_RD4PDF=${R_RD4PDF-'times,inconsolata,hyper'}
## used for options("texi2dvi")
R_TEXI2DVICMD=${R_TEXI2DVICMD-${TEXI2DVI-'/usr/bin/texi2dvi'}}
## used by INSTALL, untar() and installing grDevices
R_GZIPCMD=${R_GZIPCMD-'/bin/gzip'}
## Default zip/unzip commands
R_UNZIPCMD=${R_UNZIPCMD-'/usr/bin/unzip'}
R_ZIPCMD=${R_ZIPCMD-'/usr/bin/zip'}
R_BZIPCMD=${R_BZIPCMD-'/bin/bzip2'}
## Default browser
R_BROWSER=${R_BROWSER-'xdg-open'}
## Default editor
EDITOR=${EDITOR-${VISUAL-vi}}
## Default pager
PAGER=${PAGER-'/usr/bin/pager'}
## Default PDF viewer
R_PDFVIEWER=${R_PDFVIEWER-'/usr/bin/xdg-open'}
## Used by libtool
LN_S='ln -s'
MAKE=${MAKE-'make'}
## Prefer a POSIX-compliant sed on e.g. Solaris
SED=${SED-'/bin/sed'}
## Prefer a tar that can automagically read compressed archives
## Used in R CMD INSTALL for binary packages
TAR=${TAR-'/bin/tar'}
## System and compiler types.
R_SYSTEM_ABI='linux,gcc,gxx,gfortran,?'
R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-pc-linux-gnu-library/3.1'}
#R_LIBS_USER=${R_LIBS_USER-'~/Library/R/3.1/library'}
# edd Apr 2003 Allow local install in /usr/local, also add a directory for
# Debian packaged CRAN packages, and finally the default dir
# edd Jul 2007 Now use R_LIBS_SITE, not R_LIBS
R_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library'}
### Local Variables: ***
### mode: sh ***
### sh-indentation: 2 ***
### End: ***