## R for Statistics and Graphics (Session 1) ## Mehmet Tevfik DORAK ## Web link: http://www.dorak.info/r ## This script is for installing all necessary R packages for this course (assuming R 4.0.0 or higher is already installed) ## If these are not already installed, please go ahead ## Open this file on R via Files/Open Script.. ## Highlight the text in Section 1 and press CTRL + R; repeat this for each section (section 4b is for manual installation) ## During the process, if asked: .... Would you like a personal library instead? Say, YES ## Then, say YES to the suggested folder location (usually a subfolder within Documents folder) ## If asked, "Do you want to install from sources ....?" Say, NO ## Section 1 ## Select the mirror site to download the packages from: chooseCRANmirror() # Select one of the sites and press OK ## Run the following command to downloadd and install all of those packages in one go: install.packages(c("fBasics", "psych", "DataExplorer", "epiR", "rmeta", "pwr", "corrgram", "DescTools", "readxl", "xlsx", "plotrix", "pROC", "tidyverse", "ggthemes", "Rcmdr", "RColorBrewer", "grid", "animation", "ggdendro", "ctv", "survival", "survminer", "logspline", "quantmod", "caret"), dependencies = TRUE) ## Section 2 install.packages(c("reshape2", "pastecs", "Hmisc", "moments", "ellipse", "gridExtra", "car", "wordcloud", "spatstat", "Rcpp", "magrittr", "tm", "SnowballC", "twitteR", "imager", "scales", "TSP", "magick", "patchwork", "datasets", "tibble", "stringr", "MASS", "HistData"), dependencies = TRUE) ## Section 3 (optional) ## If will be needed, install all packages related to phylogenetics or meta-analysis using the following commands: library('ctv') install.views("Phylogenetics") install.views("MetaAnalysis") install.views("Survival") install.views("TeachingStatistics") ## Section 4a # Make sure "devtools" is installed and up-to-date: install.packages("devtools") # Make sure "processx" is up-to-date: install.packages("processx") # Install "renotes" install.packages("remotes") ## Section 4b: MANUAL INSTALLATION # Make sure Rtools.EXE is installed and up-to-date (check https://cran.r-project.org/bin/windows/Rtools) # Install the correct EXE file like any other Windows file and follow the instructions to complete its installation (by defining the PATH) ## Section 5 ## Run the command below and see if additional downloads are necessary: library(Rcmdr) # install any missing programs ## Section 6 (MANUAL download and installation) ## For manual installation of RTools. go to: https://cran.r-project.org/bin/windows/Rtools ## Download the recommended (green line) version of RTools like any other windows exe program ## Section 7: Update Rccp as explained at: # https://rickpackblog.wordpress.com/2020/08/06/updating-rcpp-extprt_ptr-error (GitHub for Rcpp: https://github.com/RcppCore/Rcpp.git) ## For SWIRL courses to learn R in R: install.packages("swirl") # https://swirlstats.com # Installation of BioConductor (For R version 4.0.0 or higher) # SEE: https://bioconductor.org/install if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install() ## Install the following multiple Bioconductor packages with a single command: BiocManager::install(c("GenomicFeatures", "GenomicRanges", "IRanges", "AnnotationDbi", "VariantAnnotation", "myvariant", "mygene", "GWASTools", "ReactomePA", "clusterProfiler")) # At the end, make sure you have the most up-to-date version of all packages installed: update.packages(ask='graphics',checkBuilt=TRUE) # Updating Bioconductor packages if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install() # Last updated on 3 March 2021