SVM 预测 运行 在我的电脑上很好但在 R Connect 里不行

SVM prediction running fine in my computer but not in R Connect

我正在创建一个 Shiny 应用程序,它使用 caret 包进行一些 SVM 自由文本分析。

该应用程序 运行 在我的计算机中没有任何错误。我正在使用 R x64 4.0.4 和 R studio 1.3.1093

我正在将应用程序部署到内部企业服务器 https://rconnect.xxxx.com/connect/#/apps/####

此应用已部署到服务器并启动。
但是当我到达我 运行 火车功能的线路时:

cfMtxSVM <- function(mymode){
    trctrl <- caret::trainControl(method = "repeatedcv", number = 10, repeats = 3)

    form <- stats::formula(dataOneY ~.)
    grid <- expand.grid(C = c(0.01))
    svm_Linear <- caret::train(dataOneY ~., data = trainSparse, method = "svmLinear", trControl=trctrl, preProcess = c("center", "scale"), tuneLength = 10)
}

系统报错

 An error has occurred. Check your logs or contact the app author for clarification.

奇怪的是系统没有发送 trainControl

的错误

这就是日志所说的,第 478 行是带有 svm_linear 选项的行

2021/08/04 14:12:04.404008496 Warning: Error in : Required package is missing
2021/08/04 14:12:04.412768566   118: stop
2021/08/04 14:12:04.412781386   117: checkInstall
2021/08/04 14:12:04.412817143   116: train.default
2021/08/04 14:12:04.412818485   114: train.formula
2021/08/04 14:12:04.412828655   112: cfMtxSVM [/opt/rstudio-connect/mnt/app/server.r#478]

我已经通过

通过 R 和 R studio 在我的计算机中安装了插入符及其所有依赖项
 install.packages(“caret”,dependencies=TRUE)

以下是来自 RStudio 的部署日志

Preparing to deploy application...DONE
Uploading bundle for application: ####...DONE
Deploying bundle: 5614 for application: #### ...
[Connect] TimeStamp
[Connect] tIMESTAMP0.4; using /opt/R/R-4.0.5/bin/R which has version 4.0.5
[Connect] TimeStamp Using user agent string: 'RStudio R (4.0.5 x86_64-pc-linux-gnu x86_64 linux-gnu)' 
[Connect] TimeStamp linux distribution: CentOS Linux release 7.4.1708 (Core)  
[Connect] TimeStamp # Validating R library read / write permissions --------------------------------
[Connect] TimeStamp R version: 4.0.5
[Connect] TimeStamp # Validating managed packrat installation --------------------------------------
[Connect] TimeStamp Vendored packrat archive: /opt/rstudio-connect/ext/R/packrat_0.5.0-25_448aafd176ec6cbde307f556c91b39e5a1c94f9d.tar.gz
[Connect] TimeStamp Vendored packrat SHA: 448aafd176ec6cbde307f556c91b39e5a1c94f9d
[Connect] TimeStamp Managed packrat SHA:  448aafd176ec6cbde307f556c91b39e5a1c94f9d
[Connect] TimeStamp Managed packrat version: 0.5.0.25
[Connect] TimeStamp Managed packrat is up-to-date.
[Connect] TimeStamp # Validating packrat cache read / write permissions ----------------------------
[Connect] TimeStamp Audited package hashes with local packrat installation.
[Connect] TimeStamp # Installing required R packages with `packrat::restore()` ---------------------
[Connect] TimeStamp Installing BH (1.75.0-0) ... 
[Connect] TimeStamp Using cached BH.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing DBI (1.1.1) ... 
[Connect] TimeStamp Using cached DBI.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing ISLR (1.2) ... 
[Connect] TimeStamp Using cached ISLR.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing KernSmooth (2.23-20) ... 
[Connect] TimeStamp Using cached KernSmooth.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing MASS (7.3-54) ... 
[Connect] TimeStamp Using cached MASS.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing NLP (0.2-1) ... 
[Connect] TimeStamp Using cached NLP.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing R6 (2.5.0) ... 
[Connect] TimeStamp Using cached R6.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing RColorBrewer (1.1-2) ... 
[Connect] TimeStamp Using cached RColorBrewer.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing Rcpp (1.0.7) ... 
[Connect] TimeStamp Using cached Rcpp.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing SQUAREM (2021.1) ... 
[Connect] TimeStamp Using cached SQUAREM.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing SnowballC (0.7.0) ... 
[Connect] TimeStamp Using cached SnowballC.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing assertthat (0.2.1) ... 
[Connect] TimeStamp Using cached assertthat.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing backports (1.2.1) ... 
[Connect] TimeStamp Using cached backports.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing base64enc (0.1-3) ... 
[Connect] TimeStamp Using cached base64enc.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing bit (4.0.4) ... 
[Connect] TimeStamp Using cached bit.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing clipr (0.7.1) ... 
[Connect] TimeStamp Using cached clipr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing codetools (0.2-18) ... 
[Connect] TimeStamp Using cached codetools.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing colorspace (2.0-2) ... 
[Connect] TimeStamp Using cached colorspace.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing commonmark (1.7) ... 
[Connect] TimeStamp Using cached commonmark.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing cpp11 (0.3.1) ... 
[Connect] TimeStamp Using cached cpp11.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing crayon (1.4.1) ... 
[Connect] TimeStamp Using cached crayon.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing curl (4.3.2) ... 
[Connect] TimeStamp Using cached curl.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing data.table (1.14.0) ... 
[Connect] TimeStamp Using cached data.table.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing digest (0.6.27) ... 
[Connect] TimeStamp Using cached digest.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing enc (0.2.2) ... 
[Connect] TimeStamp Using cached enc.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing evaluate (0.14) ... 
[Connect] TimeStamp Using cached evaluate.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing fansi (0.5.0) ... 
[Connect] TimeStamp Using cached fansi.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing farver (2.1.0) ... 
[Connect] TimeStamp Using cached farver.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing fastmap (1.1.0) ... 
[Connect] TimeStamp Using cached fastmap.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing fs (1.5.0) ... 
[Connect] TimeStamp Using cached fs.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing generics (0.1.0) ... 
[Connect] TimeStamp Using cached generics.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing glue (1.4.2) ... 
[Connect] TimeStamp Using cached glue.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing gower (0.2.2) ... 
[Connect] TimeStamp Using cached gower.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing gtable (0.3.0) ... 
[Connect] TimeStamp Using cached gtable.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing isoband (0.2.5) ... 
[Connect] TimeStamp Using cached isoband.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing iterators (1.0.13) ... 
[Connect] TimeStamp Using cached iterators.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing jsonlite (1.7.2) ... 
[Connect] TimeStamp Using cached jsonlite.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing labeling (0.4.2) ... 
[Connect] TimeStamp Using cached labeling.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing lattice (0.20-44) ... 
[Connect] TimeStamp Using cached lattice.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing lazyeval (0.2.2) ... 
[Connect] TimeStamp Using cached lazyeval.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing magrittr (2.0.1) ... 
[Connect] TimeStamp Using cached magrittr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing mime (0.11) ... 
[Connect] TimeStamp Using cached mime.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing nnet (7.3-16) ... 
[Connect] TimeStamp Using cached nnet.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing numDeriv (2016.8-1.1) ... 
[Connect] TimeStamp Using cached numDeriv.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing pkgconfig (2.0.3) ... 
[Connect] TimeStamp Using cached pkgconfig.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing prettyunits (1.1.1) ... 
[Connect] TimeStamp Using cached prettyunits.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing proxy (0.4-26) ... 
[Connect] TimeStamp Using cached proxy.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing ps (1.6.0) ... 
[Connect] TimeStamp Using cached ps.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing randomForest (4.6-14) ... 
[Connect] TimeStamp Using cached randomForest.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing rappdirs (0.3.3) ... 
[Connect] TimeStamp Using cached rappdirs.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing rematch (1.0.1) ... 
[Connect] TimeStamp Using cached rematch.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing rlang (0.4.11) ... 
[Connect] TimeStamp Using cached rlang.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing rpart (4.1-15) ... 
[Connect] TimeStamp Using cached rpart.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing rstudioapi (0.13) ... 
[Connect] TimeStamp Using cached rstudioapi.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing slam (0.1-48) ... 
[Connect] TimeStamp Using cached slam.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing sourcetools (0.1.7) ... 
[Connect] TimeStamp Using cached sourcetools.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing stringi (1.7.3) ... 
[Connect] TimeStamp Using cached stringi.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing sys (3.4) ... 
[Connect] TimeStamp Using cached sys.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing timeDate (3043.102) ... 
[Connect] TimeStamp Using cached timeDate.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing utf8 (1.2.2) ... 
[Connect] TimeStamp Using cached utf8.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing uuid (0.1-4) ... 
[Connect] TimeStamp Using cached uuid.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing viridisLite (0.4.0) ... 
[Connect] TimeStamp Using cached viridisLite.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing withr (2.4.2) ... 
[Connect] TimeStamp Using cached withr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing xfun (0.24) ... 
[Connect] TimeStamp Using cached xfun.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing xml2 (1.3.2) ... 
[Connect] TimeStamp Using cached xml2.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing xtable (1.8-4) ... 
[Connect] TimeStamp Using cached xtable.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing yaml (2.2.1) ... 
[Connect] TimeStamp Using cached yaml.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing class (7.3-19) ... 
[Connect] TimeStamp Using cached class.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing plyr (1.8.6) ... 
[Connect] TimeStamp Using cached plyr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing wordcloud (2.6) ... 
[Connect] TimeStamp Using cached wordcloud.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing bit64 (4.0.5) ... 
[Connect] TimeStamp Using cached bit64.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing munsell (0.5.0) ... 
[Connect] TimeStamp Using cached munsell.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing tzdb (0.1.2) ... 
[Connect] TimeStamp Using cached tzdb.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing ModelMetrics (1.2.2.2) ... 
[Connect] TimeStamp Using cached ModelMetrics.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing splitstackshape (1.4.8) ... 
[Connect] TimeStamp Using cached splitstackshape.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing lubridate (1.7.10) ... 
[Connect] TimeStamp Using cached lubridate.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing cli (3.0.1) ... 
[Connect] TimeStamp Using cached cli.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing foreach (1.5.1) ... 
[Connect] TimeStamp Using cached foreach.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing Matrix (1.3-4) ... 
[Connect] TimeStamp Using cached Matrix.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing nlme (3.1-152) ... 
[Connect] TimeStamp Using cached nlme.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing processx (3.5.2) ... 
[Connect] TimeStamp Using cached processx.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing cachem (1.0.5) ... 
[Connect] TimeStamp Using cached cachem.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing ellipsis (0.3.2) ... 
[Connect] TimeStamp Using cached ellipsis.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing htmltools (0.5.1.1) ... 
[Connect] TimeStamp Using cached htmltools.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing later (1.2.0) ... 
[Connect] TimeStamp Using cached later.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing lifecycle (1.0.0) ... 
[Connect] TimeStamp Using cached lifecycle.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing purrr (0.3.4) ... 
[Connect] TimeStamp Using cached purrr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing rpart.plot (3.1.0) ... 
[Connect] TimeStamp Using cached rpart.plot.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing stringr (1.4.0) ... 
[Connect] TimeStamp Using cached stringr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing askpass (1.1) ... 
[Connect] TimeStamp Using cached askpass.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing highr (0.9) ... 
[Connect] TimeStamp Using cached highr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing markdown (1.1) ... 
[Connect] TimeStamp Using cached markdown.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing tinytex (0.32) ... 
[Connect] TimeStamp Using cached tinytex.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing tm (0.7-8) ... 
[Connect] TimeStamp Using cached tm.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing e1071 (1.7-8) ... 
[Connect] TimeStamp Using cached e1071.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing pROC (1.17.0.1) ... 
[Connect] TimeStamp Using cached pROC.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing survival (3.2-11) ... 
[Connect] TimeStamp Using cached survival.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing mgcv (1.8-36) ... 
[Connect] TimeStamp Using cached mgcv.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing callr (3.7.0) ... 
[Connect] TimeStamp Using cached callr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing vctrs (0.3.8) ... 
[Connect] TimeStamp Using cached vctrs.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing crosstalk (1.1.1) ... 
[Connect] TimeStamp Using cached crosstalk.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing htmlwidgets (1.5.3) ... 
[Connect] TimeStamp Using cached htmlwidgets.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing jquerylib (0.1.4) ... 
[Connect] TimeStamp Using cached jquerylib.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing sass (0.4.0) ... 
[Connect] TimeStamp Using cached sass.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing promises (1.2.0.1) ... 
[Connect] TimeStamp Using cached promises.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing scales (1.1.1) ... 
[Connect] TimeStamp Using cached scales.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing reshape2 (1.4.4) ... 
[Connect] TimeStamp Using cached reshape2.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing selectr (0.4-2) ... 
[Connect] TimeStamp Using cached selectr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing openssl (1.4.4) ... 
[Connect] TimeStamp Using cached openssl.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing knitr (1.33) ... 
[Connect] TimeStamp Using cached knitr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing lava (1.6.9) ... 
[Connect] TimeStamp Using cached lava.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing blob (1.2.2) ... 
[Connect] TimeStamp Using cached blob.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing hms (1.1.0) ... 
[Connect] TimeStamp Using cached hms.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing pillar (1.6.2) ... 
[Connect] TimeStamp Using cached pillar.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing tidyselect (1.1.1) ... 
[Connect] TimeStamp Using cached tidyselect.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing bslib (0.2.5.1) ... 
[Connect] TimeStamp Using cached bslib.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing DT (0.18) ... 
[Connect] TimeStamp Using cached DT.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing httpuv (1.6.1) ... 
[Connect] TimeStamp Using cached httpuv.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing httr (1.4.2) ... 
[Connect] TimeStamp Using cached httr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing ids (1.0.1) ... 
[Connect] TimeStamp Using cached ids.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing rmarkdown (2.9) ... 
[Connect] TimeStamp Using cached rmarkdown.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing prodlim (2019.11.13) ... 
[Connect] TimeStamp Using cached prodlim.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing progress (1.2.2) ... 
[Connect] TimeStamp Using cached progress.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing tibble (3.1.3) ... 
[Connect] TimeStamp Using cached tibble.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing shiny (1.6.0) ... 
[Connect] TimeStamp Using cached shiny.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing gargle (1.2.0) ... 
[Connect] TimeStamp Using cached gargle.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing formattable (0.2.1) ... 
[Connect] TimeStamp Using cached formattable.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing reprex (2.0.0) ... 
[Connect] TimeStamp Using cached reprex.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing ipred (0.9-11) ... 
[Connect] TimeStamp Using cached ipred.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing cellranger (1.1.0) ... 
[Connect] TimeStamp Using cached cellranger.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing dplyr (1.0.7) ... 
[Connect] TimeStamp Using cached dplyr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing forcats (0.5.1) ... 
[Connect] TimeStamp Using cached forcats.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing ggplot2 (3.3.5) ... 
[Connect] TimeStamp Using cached ggplot2.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing rematch2 (2.1.2) ... 
[Connect] TimeStamp Using cached rematch2.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing rvest (1.0.1) ... 
[Connect] TimeStamp Using cached rvest.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing vroom (1.5.3) ... 
[Connect] TimeStamp Using cached vroom.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing fresh (0.2.0) ... 
[Connect] TimeStamp Using cached fresh.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing shinyWidgets (0.6.0) ... 
[Connect] TimeStamp Using cached shinyWidgets.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing shinycssloaders (1.0.0) ... 
[Connect] TimeStamp Using cached shinycssloaders.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing shinydashboard (0.7.1) ... 
[Connect] TimeStamp Using cached shinydashboard.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing shinyjs (2.0.0) ... 
[Connect] TimeStamp Using cached shinyjs.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing waiter (0.2.3) ... 
[Connect] TimeStamp Using cached waiter.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing googledrive (2.0.0) ... 
[Connect] TimeStamp Using cached googledrive.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing readxl (1.3.1) ... 
[Connect] TimeStamp Using cached readxl.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing assertr (2.8) ... 
[Connect] TimeStamp Using cached assertr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing dbplyr (2.1.1) ... 
[Connect] TimeStamp Using cached dbplyr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing dtplyr (1.1.0) ... 
[Connect] TimeStamp Using cached dtplyr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing tidyr (1.1.3) ... 
[Connect] TimeStamp Using cached tidyr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing readr (2.0.0) ... 
[Connect] TimeStamp Using cached readr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing shinydashboardPlus (2.0.2) ... 
[Connect] TimeStamp Using cached shinydashboardPlus.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing googlesheets4 (1.0.0) ... 
[Connect] TimeStamp Using cached googlesheets4.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing broom (0.7.9) ... 
[Connect] TimeStamp Using cached broom.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing recipes (0.1.16) ... 
[Connect] TimeStamp Using cached recipes.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing haven (2.4.3) ... 
[Connect] TimeStamp Using cached haven.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing modelr (0.1.8) ... 
[Connect] TimeStamp Using cached modelr.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing caret (6.0-88) ... 
[Connect] TimeStamp Using cached caret.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Installing tidyverse (1.3.1) ... 
[Connect] TimeStamp Using cached tidyverse.
[Connect] TimeStamp     OK (symlinked cache)
[Connect] TimeStamp Warning message:
[Connect] TimeStamp In packrat::restore(overwrite.dirty = TRUE, prompt = FALSE, restart = FALSE) :
[Connect] TimeStamp   The most recent snapshot was generated using R version 4.0.4
[Connect] Completed packrat build against R version: '4.0.5'
[Connect] Launching Shiny application...
Application successfully deployed to https://rconnect.xxxxx.com/content/####/
Deployment completed: https://rconnect.xxxxx.com/connect/#/apps/####

我应该怎么做才能使应用程序在 r Connect 服务器中 运行?这是来自我的应用程序还是服务器端?

编辑

我没有听,而是走了很长的路:

我调试并查看 source code of checkInstall, where the find.package 触发了错误,因为它没有找到 kernlab 包。

问题是我的 install 语句在 require 检查中,但从未触发过。所以我现在总是需要 kernlab 并且只有在 find.package 不能生成包的路径时才安装。

if(length(find.package("kernlab",quiet = TRUE))==0) {
   install.packages("kernlab", quiet = TRUE, dependencies = TRUE)
}
require(kernlab, quietly = TRUE) 

Shiny 应用程序中的此类错误几乎总是由于缺少包造成的,日志证实了这一点。

原来在这种情况下我认为丢失的包是 kernlab,我只是通过阅读这里给出的文档发现的:https://topepo.github.io/caret/train-models-by-tag.html#Support_Vector_Machines. It's a suggested package,没有导入,所以评论中建议的命令heds1 会解决这个问题。

install.packages("caret", dependencies = c("Depends", "Suggests"))

或者,您可以只安装所需的软件包:

install.packages(c("caret", "kernlab"))