Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
braverock
GitHub Repository: braverock/portfolioanalytics
Path: blob/master/man/applyFUN.Rd
1433 views
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/applyFUN.R
\name{applyFUN}
\alias{applyFUN}
\title{Apply a risk or return function to a set of weights}
\usage{
applyFUN(R, weights, FUN = "mean", arguments)
}
\arguments{
\item{R}{xts object of asset returns}

\item{weights}{a matrix of weights generated from random_portfolios or \code{optimize.portfolio}}

\item{FUN}{name of a function}

\item{arguments}{named list of arguments to FUN}
}
\description{
This function is used to calculate risk or return metrics given a matrix of
weights and is primarily used as a convenience function used in chart.Scatter functions
}
\author{
Ross Bennett
}