# Rtools installed for Windows Users? ---- if(.Platform$OS.type=="windows" && !pkgbuild::has_rtools()) { warning("Depending on the current state of your package library, it might be necessary to install Rtools first: https://cran.r-project.org/bin/windows/Rtools/\n") } # Install Missing Dependent Packages ---- pkgs <- c("remotes", "circular", "colourpicker", "doSNOW", "DT", "foreach", "grid", "hunspell", "kknn", "plotly", "proxy", "readr", "Rtsne", "shiny", "shinycssloaders", "shinyjs", "shinythemes", "snow", "SnowballC", "stopwords", "stringr", "wordcloud") new.pkgs <- pkgs[!(pkgs %in% installed.packages()[,"Package"])] if(length(new.pkgs)) { cat(paste("Install missing package dependency/ies:", new.pkgs, "\n")) install.packages(new.pkgs, dependencies = T) } # Detach shinyReCoR ---- if("shinyReCoR" %in% (.packages())) { cat("Detaching currently installed shinyReCoR.\n") detach("package:shinyReCoR", unload = TRUE) } # Check for Previous Version (do we need to copy old project files) ---- if(system.file("projects", package="shinyReCoR")!="" && length(list.files(system.file("projects", package="shinyReCoR")))>0) { # User already has projects in previous version of shinyReCoR cat("Found project files in your current shinyReCoR version. Attempting to copy them to the new package folder.\n") dir.create(file.path(tempdir(), "shinyReCoR-projecttransfer")) file.copy(system.file("projects", package="shinyReCoR"), file.path(tempdir(), "shinyReCoR-projecttransfer"), recursive = T, copy.date = T, copy.mode = T) } # Now, Install the shinyReCoR Package ---- # You can but need not use ONE of the following commands # install.packages(file.choose(), repos=NULL) # Either choose the file in a dialog (remove the hash-symbol if you want to use this command) # install.packages("C:/Users/youracc/Downloads/shinyReCoR_0.2.2.tar.gz", repos=NULL, type="source") # Or put in the local path to the file (remove the hash-symbol if you want to use this command) # Check: shinyReCoR Set Up Successfully? ---- if(system.file("projects", package="shinyReCoR")!="") { # If applicable, copy the old project files to the new version if(file.exists(file.path(tempdir(), "shinyReCoR-projecttransfer"))) { # If necessary, copy the old project files into the new app version file.copy(file.path(tempdir(), "shinyReCoR-projecttransfer", "projects"), system.file("", package="shinyReCoR"), recursive = T, copy.date = T, copy.mode = T) unlink(file.path(tempdir(), "shinyReCoR-projecttransfer"), recursive = T) cat("Project files from previous package version copied. Please beware that it is possible that old projects do not work in newer versions.\n") } cat("\nInstallation of shinyReCoR complete.\nType shinyReCoR::recoApp() to start.\n") } else { warning("shinyReCoR was NOT installed properly. Check our website www.reco.science for troubleshooting or contact us at info@reco.science.") }