I am wondering if anyone has a working example of using page.RollingStyle in PApages that they could point me to? 
Using RStudio (v 0.95.256) and R (2.14.0 (2011-10-31), x86_64-pc-mingw32) I am trying this :

>  library("PApages")

>  data(managers)
>  books.Performance(managers,manager.column=1,peer.columns=c(2,3,4,5,6),index.columns=c(7,8,9,10))

and getting this


[1] "1 HAM1"
Error in page.Distribution(R, manager.column = manager.column, peer.columns = peer.columns,  :
   could not find function "VaR.traditional"

I'm able to fix that by substituting in a call to the current "VaR" function (and fixing a couple of parameters) elsewhere.

After that, the exercise fails with page.RollingStyle, e.g.

>  library(FactorAnalytics)

>  page.RollingStyle(R.fund = managers[,1,drop=FALSE], R.style = managers[,c(7,8,9,10)], method="constrained",leverage = FALSE,width = 36)
Error in checkData(R.fund) :
   The data cannot be converted into a time series.  If you are trying to pass in names from a data object with one column, you should use the form 'data[rows, columns, drop = FALSE]'.  Rownames should have standard date formats, such as '1985-03-15'.
In addition:Warning message:
In rollapply.zoo(data = merged.assets, FUN = function(x) { :
   na.pad argument is deprecated


However, when I run the checkData line outside of the function, there does not seem to be an error - and the rownames have the correct format.

Does anyone happen to have newer/fixed versions of page.RollingStyle that they can share?  Or can I be pointed to a fix for it?

FWIW, below is the version of page.Distribution that I got to work.  I *think* my changes (noted with the initials MattC) are correct, but would welcome feedback.
Regards,
Matt

new page.Distribution code :

function (R, manager.column = 1, peer.columns = NULL, index.columns = NULL,
     manager.color = "red", peer.color = "darkgray", index.color = "orange",
     rf = 0, event.lines = NULL, event.labels = NULL, legend.loc = "topleft",
     lwd = 1, width = 36, main = NULL, ...)
{
     x = checkData(R, method = "zoo")
     colnames = colnames(x)
     ncols = ncol(x)
     length.column.one = length(x[, manager.column])
     start.row = 1
     start.index = 0
     while (is.na(x[start.row, manager.column])) {
         start.row = start.row + 1
     }
     x = x[start.row:length.column.one, ]
     nrows = nrow(x)
     colorset = c(rep(manager.color, length(manager.column)),
         rep(peer.color, length(peer.columns)))
     legend.colorset = c(rep(manager.color, length(manager.column)),
         peer.color)
     linetypes = c(rep(1, length(manager.column)), rep(1, length(peer.columns)))
     legend.linetypes = c(rep(1, length(manager.column)), 1)
     dottypes = c(rep(1, length(manager.column)), rep(1, length(peer.columns)))
     legend.dottypes = c(rep(1, length(manager.column)), NULL)
     if (ncols>  1) {
         legend.loc = legend.loc
         legendnames = c(colnames(x[, manager.column, drop = FALSE]),
             "Peer group")
     }
     else legend.loc = NULL
     hVaR = quantile(as.vector(x[, c(manager.column), drop = FALSE]),
         probs = 0.01, na.rm = TRUE)[[1]]
     pVaR = -VaR(x[, c(manager.column), drop = FALSE], #MattC
         p = 0.99, method="historical")  #MattC
     mVaR = -VaR(x[, c(manager.column), drop = FALSE], #MattC
         p = 0.99, method="modified") #MattC
     library(sn)
     fit.st = st.mle(y = na.omit(x[, c(manager.column), drop = FALSE]))
     stVaR = qst(0.01, location = fit.st$dp[[1]], scale = fit.st$dp[[2]],
         shape = fit.st$dp[[3]], df = fit.st$dp[[4]], log = FALSE)
     require("fBasics")
     fit.stable = stableFit(as.vector(na.omit(x[, c(manager.column)])),
         doplot = FALSE)
     spVaR = qstable(0.01, alpha = fit.stable@fit$estimate[[1]],
         beta = fit.stable@fit$estimate[[2]], gamma = fit.stable@fit$estimate[[3]],
         delta = fit.stable@fit$estimate[[4]], pm = 0)
     detach("package:fBasics", unload = TRUE)
     detach("package:timeSeries", unload = TRUE)
     detach("package:timeDate", unload = TRUE)
     op<- par(no.readonly = TRUE)
     layout(matrix(c(1, 2, 3, 4, 5, 6), ncol = 2, byrow = TRUE),
         height = c(1, 1, 1), width = 1)
     par(cex = 0.8)
     chart.Histogram(x[, c(manager.column), drop = FALSE],
         probability = TRUE,
         show.outliers = TRUE,
         main = "Gaussian",
         note.lines = c(hVaR, pVaR, mVaR, stVaR, spVaR),
         note.labels = c("Historical VaR", "Parametric VaR", "Modified VaR", "", ""),
         note.color = c("darkblue", "darkgray", "darkgray", "darkgray", "darkgray"),
         methods = c("add.density", "add.normal"),
         cex.axis = 0.8, cex.lab = 0.8) #MattC
     par(cex = 0.8)
     chart.QQPlot(x[, c(manager.column), drop = FALSE], main = "QQ Fit To Gaussian",
         distribution = "norm", envelope = 0.99, xlab = "Normal Quantiles")
     par(cex = 0.8)
     chart.Histogram(x[, c(manager.column), drop = FALSE],
         probability = TRUE,
         show.outliers = TRUE,
         main = "Skew-T", note.lines = c(hVaR, pVaR, mVaR, stVaR, spVaR),
         note.labels = c("", "", "", "Skew-T VaR", ""),
         note.color = c("darkgray", "darkgray", "darkgray", "darkblue", "darkgray"),
         methods = "add.sst",
         cex.axis = 0.8, cex.lab = 0.8) #MattC
     par(cex = 0.8)
     chart.QQPlot(x[, c(manager.column), drop = FALSE], main = "QQ Fit To Skew-T",
         envelope = 0.99, distribution = "st", location = fit.st$dp[[1]],
         scale = fit.st$dp[[2]], shape = fit.st$dp[[3]], df = fit.st$dp[[4]],
         #log = FALSE, #MattC??
         xlab = "Skew-T Quantiles")
     require(fBasics)
     par(cex = 0.8)
     chart.Histogram(x[, c(manager.column), drop = FALSE], probability = TRUE,
         show.outliers = TRUE,
         main = "Stable",
         note.lines = c(hVaR, pVaR, mVaR, stVaR, spVaR),
         note.labels = c("", "", "", "", "Stable VaR"),
         note.color = c("darkgray", "darkgray", "darkgray", "darkgray", "darkblue"),
         methods = "add.stable",
         cex.axis = 0.8, cex.lab = 0.8)
     par(cex = 0.8)
     chart.QQPlot(x[, c(manager.column), drop = FALSE], main = "QQ Fit To Stable",
         envelope = 0.99, distribution = "stable", alpha = fit.stable@fit$estimate[[1]],
         beta = fit.stable@fit$estimate[[2]], gamma = fit.stable@fit$estimate[[3]],
         delta = fit.stable@fit$estimate[[4]], pm = 0)
     par(op)
}



	[[alternative HTML version deleted]]

