<My computing environment>
OS: Mac OS X Yosemite Version 10.10.3
You should be able to get sample codes on this blog tested, on the Windows environment as well. Please install the appropriate files/packages, based on your computer environment.
<R Sources/Binaries on CRAN>
- Download the following R binary and install it.
R 3.2.0 binary for Mac OS X 10.9 (Mavericks) and higher, signed package.
R-3.2.0.pkg
<Packages on CRAN>
- Download the following R packages.
# From [1] to [10]
PerformanceAnalytics: Econometric tools for performance and risk analysis
http://cran.r-project.org/web/packages/PerformanceAnalytics/index.html
OS X Mavericks binaries: r-release:
PerformanceAnalytics_1.4.3541.tgz
quantmod:Quantitative Financial Modelling Framework
http://cran.r-project.org/web/packages/quantmod/index.html
OS X Mavericks binaries: r-release:
quantmod_0.4-4.tgz
xts: eXtensible Time Series
http://cran.r-project.org/web/packages/xts/index.html
OS X Mavericks binaries: r-release:
xts_0.9-7.tgz
zoo: S3 Infrastructure for Regular and Irregular Time Series (Z's Ordered Observations)
cran.r-project.org/package=zoo
OS X Mavericks binaries: r-release:
zoo_1.7-12.tgz
TTR: Technical Trading Rules
cran.r-project.org/package=TTR
# [11] Portfolio Optimization
quadprog: Functions to solve Quadratic Programming Problems
http://cran.r-project.org/web/packages/quadprog/index.html
timeDate: Rmetrics - Chronological and Calendar Objects
http://cran.r-project.org/package=timeDate
timeSeries: Rmetrics - Financial Time Series Objects
http://cran.r-project.org/package=timeSeries
fBasics: Rmetrics - Markets and Basic Statistics
http://cran.r-project.org/package=fBasics
fAssets: Rmetrics - Analysing and Modelling Financial Assets
http://cran.r-project.org/package=fAssets
fMultivar: Rmetrics - Analysing and Modeling Multivariate Financial Return Distributions
http://cran.r-project.org/package=fMultivar
robustbase: Basic Robust Statistics
http://cran.r-project.org/package=robustbase
sn: The Skew-Normal and Skew-t Distributions
http://cran.r-project.org/package=sn
mnormt: The Multivariate Normal and t Distributions
http://cran.r-project.org/package=mnormt
numDeriv: Accurate Numerical Derivatives
http://cran.r-project.org/package=numDeriv
fCopulae: Rmetrics - Bivariate Dependence Structures with Copulae
http://cran.r-project.org/package=fCopulae
Rglpk: R/GNU Linear Programming Kit Interface
http://cran.r-project.org/package=Rglpk
Rsolnp: General Non-linear Optimization
http://cran.r-project.org/package=Rsolnp
truncnorm: Truncated normal distribution
http://cran.r-project.org/package=truncnorm
kernlab: Kernel-based Machine Learning Lab
http://cran.r-project.org/package=kernlab
XML: Tools for Parsing and Generating XML Within R and S-Plus
http://cran.r-project.org/package=XML
fPortfolio: Rmetrics - Portfolio Selection and Optimization
http://cran.r-project.org/package=fPortfolio
stockPortfolio: Build stock models and analyze stock portfolios
http://cran.r-project.org/web/packages/stockPortfolio/index.html
ggplot2: An Implementation of the Grammar of Graphics
http://cran.r-project.org/web/packages/ggplot2/index.html
reshape2: Flexibly Reshape Data: A Reboot of the Reshape Package
digest: Create Cryptographic Hash Digests of R Objects
http://cran.r-project.org/web/packages/digest/index.html
gtable: Arrange grobs in tables
http://cran.r-project.org/web/packages/gtable/index.html
plyr: Tools for Splitting, Applying and Combining Data
http://cran.r-project.org/web/packages/plyr/index.html
Rcpp: Seamless R and C++ Integration
http://cran.r-project.org/web/packages/Rcpp/index.html
proto: Prototype object-based programming
http://cran.r-project.org/web/packages/proto/index.html
stringr: Simple, Consistent Wrappers for Common String Operations
http://cran.r-project.org/web/packages/stringr/index.html
stringi: Character String Processing Facilities
http://cran.r-project.org/web/packages/stringi/index.html
magrittr: A Forward-Pipe Operator for R
http://cran.r-project.org/web/packages/magrittr/index.html
scales: Scale Functions for Visualization
http://cran.r-project.org/web/packages/scales/index.html
labeling: Axis Labeling
install.packages()
- Start the installed R console and then install packages (Unlike library() below, it's one-time procedure and you do not need to do it again.).
install.packages(path_to_file, repos = NULL, type="source")
sample codes (Mac OS X)
install.packages("~/Google Drive/Finance/R/PerformanceAnalytics_1.4.3541.tar", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/quantmod_0.4-4.tar", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/xts_0.9-7.tar", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/zoo_1.7-12.tar", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/TTR_0.22-0.tgz", repos = NULL, type="source")
# [11] Portfolio Optimization
install.packages("~/Google Drive/Finance/R/fPortfolio_3011.81.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/quadprog_1.5-5.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/timeDate_3012.100.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/timeSeries_3012.99.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/fBasics_3011.87.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/fAssets_3011.83.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/fMultivar_3011.78.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/robustbase_0.92-4.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/DEoptimR_1.0-2.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/ecodist_1.2.9.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/mvnormtest_0.1-9.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/energy_1.6.2.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/sn_1.2-2.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/mnormt_1.5-3.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/numDeriv_2014.2-1.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/fCopulae_3011.81.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/Rglpk_0.6-1.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/slam_0.1-32.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/Rsymphony_0.1-17.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/Rsolnp_1.15.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/truncnorm_1.0-7.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/kernlab_0.9-20.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/rneos_0.2-8.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/XML_3.98-1.3.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/RCurl_1.95-4.7.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/bitops_1.0-6.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/stockPortfolio_1.2.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/ggplot2_1.0.1.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/reshape2_1.4.1.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/digest_0.6.8.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/gtable_0.1.2.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/plyr_1.8.3.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/Rcpp_0.11.6.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/proto_0.3-10.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/stringr_1.0.0.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/stringi_0.5-5.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/magrittr_1.5.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/scales_0.2.5.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/munsell_0.4.2.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/colorspace_1.2-6.tgz", repos = NULL, type="source")
install.packages("~/Google Drive/Finance/R/labeling_0.3.tgz", repos = NULL, type="source") |