getPotencialGain | R Documentation |
getPotencialGain(obj, from, to)
obj |
|
from |
|
to |
##---- 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 (obj, from, to)
{
tickets <- as.character(read.csv("objTickets.csv")[[1]])
newObj <- new.env()
for (ticket in tickets) {
print(ticket)
ds <- obj[[ticket]]
lfrom <- from
year <- c()
gain <- c()
if (class(ds) == "data.frame") {
while (as.numeric(lfrom) <= as.numeric(to)) {
gain <- c(gain, getPotencialYearGain(ds, lfrom))
year <- c(year, lfrom)
lfrom <- as.character(as.numeric(lfrom) + 1)
}
newObj[[ticket]] <- data.frame(year, gain)
}
}
return(newObj)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.