# nuevo script de instalación de paquetes  R, H. LAUDE ,v1

# atención  verificar que rstudio está configurado en utf-8 >>> Ã©Ã¨Ã¯Ã®Ã¹
# si hay problemas de versión más antigua que el nuevo código fuente
# responder no Ã  Ventana modal  que se abre (durante este tiempo todo parece bloqueado porque se espera su respuesta)

# Tools to Make Developing R Packages Easier 
install.packages('devtools',
                 repos = "http://cran.us.r-project.org")

install.packages("Rcpp",dependencies=TRUE,
                 repos = "http://cran.us.r-project.org")     # C


# Unified Parallel and Distributed Processing in R for Everyone
install.packages("future",dependencies=TRUE,
                 repos = "http://cran.us.r-project.org")

#Character String Processing Facilities 
install.packages("stringi",dependencies=TRUE,
                 repos = "http://cran.us.r-project.org")

# otro repositorio
## responder a (all) a la primera
## y n a la segunda
source("http://bioconductor.org/biocLite.R")
# o : source("https://bioconductor.org/biocLite.R")
biocLite()
biocLite("EBImage")

# si se puede ver la lista de los paquetes tidyverse hacer: tidyverse_packages(include_self = TRUE)
install.packages("tidyverse",dependencies=TRUE,
                 repos = "http://cran.us.r-project.org")


# paquetea anaconda "style"
install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'uuid', 'digest'),
                 dependencies=TRUE,
                 repos = "http://cran.us.r-project.org")
devtools::install_github('IRkernel/IRkernel', force = TRUE)
IRkernel::installspec(user = FALSE)

# Low-Level R to Java Interface
# java, verificar instalando previamente JRE en 64 bit o en 32 pero no mic mac
install.packages("rJava", 
                 dependencies=TRUE,
                 repos = "http://cran.us.r-project.org")
library('rJava') # para verificar que realmente está ok

# Miscellaneous R Functions 
install.packages("rccmisc", dependencies=TRUE,repos = "http://cran.us.r-project.org")


## instalación con una parte interactiva, puede ser zapeadosi es posible
install.packages("RGtk2", dependencies=TRUE)
library('RGtk2') # elegir instalar gtk+
## fin interactivo - leer los warnings ! volver a lanzar R a continuación

## trees
install.packages("rpart", dependencies=TRUE
                 ,repos = "http://cran.us.r-project.org")
install.packages("rpart.plot", dependencies=TRUE
                 ,repos = "http://cran.us.r-project.org") # para fancyRpartPlot
library('rpart')
library('rpart.plot')


#######################################################
## trabajos actuales - aplica muchas dependencias  ##

# Parametric Bootstrap and Kenward Roger Based Methods for Mixed Model Comparison 
install.packages(c("pbkrtest"), dependencies=TRUE,repos = "http://cran.us.r-project.org") # para rattle

# Read, write, format Excel 2007 and Excel 97/2000/XP/2003 files
install.packages("xlsx", dependencies=TRUE,repos = "http://cran.us.r-project.org")
require(xlsx)

# Parsimonious Gaussian Mixture Models
install.packages("pgmm", dependencies=TRUE,repos = "http://cran.us.r-project.org")

# Classification and Regression Training : INDISPENSABLE !
install.packages("caret", dependencies=TRUE,repos = "http://cran.us.r-project.org")       # con dependencia completa

install.packages("ElemStatLearn", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("kernlab", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages('e1071', dependencies=TRUE,repos = "http://cran.us.r-project.org") # del paquete e1071 para glm
install.packages('AppliedPredictiveModeling', dependencies=TRUE,repos = "http://cran.us.r-project.org")

# TIME ...
install.packages("forecast", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("lubridate", dependencies=TRUE,repos = "http://cran.us.r-project.org")

# INTERFACES INTERACTIVAS
install.packages("rattle", dependencies=TRUE,repos = "http://cran.us.r-project.org")
library(rattle)
rattle() # test rattle, cierre posterior

install.packages("JGR", dependencies=TRUE,repos = "http://cran.us.r-project.org")
library(JGR)
JGR() # gestión de paquetes y consola R super !!!


## varios trabajos con redundancia 
install.packages("dplyr", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("magrittr", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("corrplot", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages('tm', dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages('RTextTools', dependencies=TRUE,repos = "http://cran.us.r-project.org")  # hay que retomarlo varias veces
install.packages('SparseM', dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages('RTextTools', dependencies=TRUE,repos = "http://cran.us.r-project.org")

install.packages("RJSONIO", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages('ggvis',dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("mime", dependencies=TRUE,repos = "http://cran.us.r-project.org")


# rCharts , respetar el orden de las instalaciones!!!
# Interactive Charts using Javascript Visualization Libraries
install.packages("downloader", dependencies=TRUE,repos = "http://cran.us.r-project.org")
library(downloader)
download("https://github.com/ramnathv/rCharts/archive/master.tar.gz", "rCharts.tar.gz")
install.packages('whisker',dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages('plyr',dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages('RCurl',dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("rCharts.tar.gz", repos = NULL, type = "source")
library(rCharts)
## fin rCharts

# Fuzzy Rule-Based Systems for Classification and Regression Tasks
install.packages("frbs", dependencies=TRUE,repos = "http://cran.us.r-project.org")

# Conjunto Partial Least Squares Regression
install.packages("enpls", dependencies=TRUE,repos = "http://cran.us.r-project.org")

install.packages("twitteR", dependencies=TRUE,repos = "http://cran.us.r-project.org")

# spatial y javascript
install.packages("networkD3", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("leaflet", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("sp", dependencies=TRUE,repos = "http://cran.us.r-project.org")

# Snowball stemmers based on the C libstemmer UTF-8 library : Stem multi land
install.packages("SnowballC", dependencies=TRUE,repos = "http://cran.us.r-project.org")

# R commander, GUI INTERACTIF R
install.packages("rgl", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("Rcmdr", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("epitools", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("prettyR", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("epicalc", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("rmarkdown", dependencies=TRUE,repos = "http://cran.us.r-project.org")
library(Rcmdr)


# FastICA Algorithms to Perform ICA and Projection Pursuit
install.packages("fastICA", dependencies=TRUE,repos = "http://cran.us.r-project.org")

# Display and Analyze ROC Curves
install.packages("pROC", dependencies=TRUE,repos = "http://cran.us.r-project.org")

# Quantile Regression
install.packages("quantreg", dependencies=TRUE,repos = "http://cran.us.r-project.org")
# Quality Control Charts
install.packages("qcc",dependencies=TRUE,repos = "http://cran.us.r-project.org")

# doBy, orden y Groupwise Statistics, LSmeans, Linear Contrasts, Utilities 
install.packages("doBy",dependencies=TRUE,repos = "http://cran.us.r-project.org")

# mejoras gráficas
install.packages("scales",dependencies=TRUE,repos = "http://cran.us.r-project.org")
library(ggplot2)
devtools::install_github('ggthemr', 'cttobin')

# Parallelized Minimum Redundancy, Maximum Relevance (mRMR) Ensemble Feature Selection
install.packages("mRMRe",repos = "http://cran.us.r-project.org")
library(mRMRe)

# Collection of functions for matrix calculations
install.packages("matrixcalc",dependencies=TRUE,repos = "http://cran.us.r-project.org")

# R Image Processing and Analysis
install.packages("ripa", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")

# Accurate Timing Functions
install.packages("microbenchmark", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")


## inicio de la instalación complementos de lattice y ejemplo
srcdir <- "http://lmdvr.r-forge.r-project.org/code/"
destdir <- "." # modify as desired
chapters <- sprintf("Chapter%02d.R", 1:14)

for (i in chapters)
{
  download.file(url = paste(srcdir, i, sep = ""),
                destfile = file.path(destdir, i))
}

install.packages(c("latticeExtra", "copula", "ellipse", "gridBase",
                   "locfit", "logspline", "mapproj", "maps", "MEMSS",
                   "mlmRev", "RColorBrewer"), 
                   dependencies=c("Depends", "Suggests"),
                    repos = "http://cran.us.r-project.org")
source("http://bioconductor.org/biocLite.R")
biocLite(c("flowCore", "flowViz", "hexbin"))
## fin instalación lattice complementos ejemplos


# gráfico
install.packages("ggthemes", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("plot3D", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
# GGobi is a free statistical software tool for interactive data visualization. 
source("http://www.ggobi.org/downloads/install.r") # Interface Between R and 'GGobi


install.packages("lsa", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")

install.packages("leaps", dependencies=TRUE,repos = "http://cran.us.r-project.org")

install.packages('caretEnsemble', dependencies=TRUE,repos = "http://cran.us.r-project.org")

install.packages('mlbench') # super para verificar algo machine learning

install.packages("pso",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")

install.packages("lhs",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")

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

install.packages("DiceKriging",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")

install.packages("deepnet",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")

install.packages("mxnet",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")

install.packages("neuralnet",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")

install.packages("mvoutlier",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("robCompositions",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")

install.packages("shiny", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("shinythemes", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("shinydashboard", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("shinyapps", dependencies=TRUE,repos = "http://cran.us.r-project.org")

install.packages("rsconnect", dependencies=TRUE,repos = "http://cran.us.r-project.org")

install.packages("acepack", dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("biclust", dependencies=TRUE,repos = "http://cran.us.r-project.org")


install.packages("minqa", dependencies=TRUE,repos = "http://cran.us.r-project.org") # des fois que

install.packages("RMySQL", dependencies=TRUE,repos = "http://cran.us.r-project.org")

install.packages("checkpoint",repos = "http://cran.us.r-project.org")
install.packages("GGally",repos = "http://cran.us.r-project.org")
install.packages('tableHTML',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages('quantmod',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages('RqcppRoll',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages('exploratory',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")


## bonitos diseños en ggplot2 y aplica un gran número de dependencias
install.packages('scales',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages('GGally',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org") # las dependencias
install.packages('progress',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages('prettyunits',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
##

install.packages('pso',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages('lhs',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages('neuralnet',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")


install.packages('mlmRev',dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org") #data sets de test

##shiny
install.packages("shiny",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("shinythemes",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("shinydashboard",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("shinyapps",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("rsconnect",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
if (!require("devtools")) install.packages("devtools",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
# you may also need to update packages: update.packages(ask = FALSE)
devtools::install_github("rstudio/rmdexamples")
##

## FactoMiner para ACP ...
install.packages("FactoMineR",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("flashClust",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
##

## lectura/escritura rápida y conveniente de archivos "rectangulares"
## csv excel_csv_utf8 tsv fwf web_log, compacto en gz bz2 xz si quiere
## manejar na y missing intelligemment
## puede leer escribir línea por línea
## contiene funciones de parseo para fecha, entero, número...
## permite almacenar la lista de advertencias... por ejemplo en un análisis
## factor de análisis bajo demanda
## puede almacenar factores de cadena
## readr::locales permite adaptar la codificación car y el formato de fecha al país
install.packages("readr",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
##
install.packages("pdftools",dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")

## instalación Rweka y ANLP
install.packages("RWekajars", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("RWeka", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
# rq : ANLP aplica muchos otros paquetes, c practico!
install.packages("chron", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("qdapTools", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("openNLP", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("openNLPdata", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("reports", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("venneuler", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("wordcloud", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
install.packages("ANLP", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")
library(ANLP) # para ver si weka está ok
##


install.packages("algorithmia", dependencies=c("Depends", "Suggests"),repos = "http://cran.us.r-project.org")


install.packages("sets" ,dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("lambda.tools",dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("pryr",dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("functional",dependencies=TRUE,repos = "http://cran.us.r-project.org")

install.packages("filehash",dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("sqldf",dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("ff",dependencies=TRUE,repos = "http://cran.us.r-project.org")

# A Swiss-Army Knife for Data I/O  (responder sí  a la carga de documentos)
install.packages("rio",dependencies=TRUE,repos = "http://cran.us.r-project.org")
require(rio)
install_formats()


install.packages("reticulate",dependencies=TRUE,repos = "http://cran.us.r-project.org")


# spatial carto ...
install.packages("maptools",dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("ggmap",dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("rgeos",dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("tmap",dependencies=TRUE,repos = "http://cran.us.r-project.org") #instala n dependencias
install.packages("sf",dependencies=TRUE,repos = "http://cran.us.r-project.org")
install.packages("rgdal",dependencies=TRUE,repos = "http://cran.us.r-project.org") # Bindings for the 'Geospatial' Data Abstraction Library




library(reticulate) 
py_available() # TRUE !!
### 

# para probar la naturaleza de los objetos
install.packages("tester",dependencies=TRUE,repos = "http://cran.us.r-project.org")
