getCATickets | R Documentation |
getCATickets(tickets)
tickets |
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (tickets)
{
tryCatch({
wTickets <- as.data.frame(tickets[1:7])
wlm <- c(summary(lm(wTickets[, 1] ~ index(wTickets[,
1])))$coefficients[2])
if ((NROW(tickets) - 6) > 1) {
return(c(wlm, getCATickets(tickets[-1])))
}
else {
return(wlm)
}
}, error = function(e) {
print(paste("Error:", e))
return(c(-1))
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.