Learn R Programming

SPOT (version 2.1.10)

plotPrediction: plotPrediction

Description

plot predictions countries/regions by index

Usage

plotPrediction(regionDf, countryIndex = 1, ylog = FALSE)

Arguments

regionDf

A list containing a representation of the data.

countryIndex

num Index

ylog

logical plot log y axis (log = y)

Value

A plot

Examples

Run this code
# NOT RUN {
require(SPOT)
data <- preprocessInputData(regionTrain, regionPopulation)
testData <- preprocessTestData(regionTest)
# Select the first region:
testData <- testData[testData$Region==levels(testData$Region)[1], ]
testData$Region <- droplevels(testData$Region)
# Very small number of function evaluations:
n <- 6
res <- lapply(data[1], tuneRegionModel, pops=NULL, 
              control=list(funEvals=n, designControl=list(size=5), model = buildLM))
parsedList <- parseTunedRegionModel(res)
pred <- generateMCPrediction(testData = testData, models = parsedList$models, write = FALSE)
quickPredict <- cbind(pred, testData$Date, testData$Region)
names(quickPredict) <- c("ForecastID", "confirmed", "fatalities", "date", "region")
p <- plotPrediction(quickPredict, 1)
# }

Run the code above in your browser using DataLab