buildHistMat | R Documentation |
After each scoring context is processed, the EA process outputs a set
of statistics to the AS process. This file scans through the logs of
those messages to build a data frame showing the history of the
recorded statistics over time. The function buildHistMat
builds a matrix for a single user, and the function
buildAppHist
loops over all users in the database.
buildHistMat(col, app, uid)
buildAppHist(col, app)
col |
The |
app |
A character value identifying the application to build the history for. The long guid for the application is required here. |
uid |
A character value ident;yfing the user for whom to build the history. |
The statistics must be logged in a database collection for this to
work. Note that the configStats
function will determine
which values are logged.
A data.frame
object with the following fields:
The guid of the application.
The identifier for the user.
An identifier for the scoring context (e.g., game level).
The timestamp for the last event from the scoring context.
Other fields correspoonding to the statsitics.
Russell Almond
woeBal
, EAPBal
ListenerSet
## Not run:
## excerpt from doRunrun
if (!is.null(EA.config$histListener)) {
hl <- eng$listenerSet$listeners[[EA.config$histListener]]
if (is.null(hl)) {
flog.warn("History listener %s not found, skipping building history file.",
EA.config$histListener)
} else {
hist <- buildAppHist(hl$messdb(),appid)
if (isTRUE(nrow(hist) > 0L)) {
hist$app <- basename(hist$app)
fname <- gsub("<app>",sappid,EA.config$histfile)
write.csv(hist,file.path(outdir,fname))
EAeng.params$listenerSet$registerOutput(fname,file.path(outdir,fname),
appid,"EA")
} else {
flog.warn("No records in history file.")
}
}
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.