Load the PortfolioAnalytics package
The package PortfolioAnalytics will be used throughout this course for portfolio optimization and analysis. We will use the indexes dataset that is included with the PortfolioAnalytics package for the remaining exercises in this chapter. In this exercise, we will load the package and prepare the data for the portfolio optimization problem in the next exercise.
Questo esercizio fa parte del corso
Intermediate Portfolio Analysis in R
Istruzioni dell'esercizio
- Load the
PortfolioAnalyticspackage. - Load the
indexesdataset. - Subset the
indexesdataset to use the first four columns and assign to a variable namedindex_returns. - Print the
headof theindex_returns.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Load the package
# Load the data
# Subset the data
# Print the head of the data