Crypto Selector - R ---Example notebook doesnt work Environment problem?

Hello
The example notebook doesn’t work for me and i tried to restart several times my session and even my computer:


The complete message is :

send2Log: The payout parameters have been updated
send2Log: Generating portfolio weights using: equalWeightCryptoSelect payout
send2Log: loading the return Matrix…
send2Log: Filling returns matrix with bb_live field from dataFeatures
send2Log: loading features and assets data …

Warning message in send2Log(warning(“features object used for the first slot of the payout”)):
“features object used for the first slot of the payout”

send2Log: features object used for the first slot of the payout

Error in if (rebalancing == “monthly”) dates = sort(as.Date(index(weights)[!duplicated(format(index(weights), : argument is of length zero
Traceback:

  1. eval(port, zoom = “2017::2020”)
  2. eval(port, zoom = “2017::2020”)
  3. portfolio.eval(object = expr, …)
  4. portfolio.evalWeights(port, …, zoom = zoom, period = period,
    . lastN = lastN, payoutWithFeatures = payoutWithFeatures, lag = port@lag)
  5. do.call(object@portfolioPayout, c(list(object@features), object@payoutParams))
  6. (function (features, rebalancing = “monthly”, verbose = FALSE)
    . {
    . df = dataFeatures.subset(features, fields = “bb_live”)
    . weights = na.locf(df@pxs) * 0 + 1
    . if (rebalancing == “monthly”)
    . dates = sort(as.Date(index(weights)[!duplicated(format(index(weights),
    . “%m%Y”))]))
    . if (rebalancing == “weekly”)
    . dates = sort(as.Date(index(weights)[!duplicated(format(index(weights),
    . “%Y%W”))]))
    . if (rebalancing == “daily”)
    . dates = as.Date(index(weights))
    . weights = weights[dates, ]
    . weights = na.locf(weights/rowSums(weights, na.rm = TRUE))
    . if (verbose)
    . print(tail(weights, n = 20))
    . return(invisible(na.trim(weights)))
    . })(<S4 object of class structure(“dataFeatures”, package = “SinglePackageAl”)>,
    . NULL)

Could someone help?
Qiang

Hi @petitfort ,

Let us get back to you quickly. Could you replace eval with portfolio.eval and see if it works?

Manas