plotFlowbased | R Documentation |
Plot flow-based domain(s)
plotFlowbased(
PLAN,
PLAN2 = NULL,
VERT = NULL,
VERT2 = NULL,
country1,
country2,
hours,
dates,
hours2 = NULL,
dates2 = NULL,
domainsNames = NULL,
hubDrop = list(NL = c("BE", "DE", "FR", "AT")),
hubDrop2 = NULL,
xlim = c(-10000, 10000),
ylim = c(-10000, 10000),
main = NULL,
width = "420px",
height = "410px",
color = NULL,
export = F
)
PLAN |
PLAN is generated in this format with the function getPreprocPlan |
PLAN2 |
|
VERT |
|
VERT2 |
|
country1 |
|
country2 |
|
hours |
|
dates |
|
hours2 |
|
dates2 |
|
domainsNames |
|
hubDrop |
|
hubDrop2 |
|
xlim |
|
ylim |
|
main |
|
width |
|
height |
|
color |
|
export |
|
## Not run:
library(data.table)
library(rAmCharts)
PLAN <- getPreprocPlan(
pathPtdfMatrixFactor = system.file(
"testdata/plan_new_version_factor_AT.rds", package = "fbClust"),
pathPtdfMatrixConstraint = system.file(
"testdata/plan_new_version_constraint_AT.rds", package = "fbClust"))
hubDrop = list(NL = c("BE", "DE", "FR", "AT"))
#Plot unique polyhedron
plotFlowbased(PLAN, country1 = "BE", country2 = "DE", hubDrop = hubDrop,
hours = c(2), dates = c("2018-10-02"), domainsNames = "2018-10-02", main = "")
#Plot four polyhedra
plotFlowbased(PLAN, country1 = "BE", country2 = "DE", hubDrop = hubDrop,
hours = c(3, 4), dates = c("2018-10-02", "2018-10-04"), domainsNames = NULL,
main = NULL)
#Plot two domains from cwe_at and one domain from cwe in the same graphic
PLAN2 <- copy(PLAN)
PLAN2 <- PLAN2[Date == "2018-10-04"]
PLAN2[, ptdfAT := NULL]
hubDrop2 <- list("NL" = list("BE", "DE", "FR"))
plotFlowbased(PLAN, PLAN2 = PLAN2, country1 = "BE", country2 = "DE",
hubDrop = hubDrop, hubDrop2 = hubDrop2,
hours = c(3, 4), dates = c("2018-10-02"),
hours2 = c(4), dates2 = c("2018-10-04"),
domainsNames = NULL, main = NULL)
# Plot two domains from cwe and cwe-at at the same hours
PLAN3 <- copy(PLAN)
PLAN3[, ptdfAT := NULL]
hubDrop2 <- list("NL" = list("BE", "DE", "FR"))
plotFlowbased(PLAN, PLAN2 = PLAN3, country1 = "BE", country2 = "DE",
hubDrop = hubDrop, hubDrop2 = hubDrop2,
hours = c(3, 4), dates = c("2018-10-02"),
hours2 = c(3, 4), dates2 = c("2018-10-02"),
domainsNames = NULL, main = NULL)
# Examples with colors chosen
plotFlowbased(PLAN, country1 = "AT", country2 = "DE",
hubDrop = hubDrop,
hours = c(3), dates = c("2018-10-02", "2018-10-03"),
domainsNames = NULL, main = NULL,
color = c("#CC0000", "purple"))
plotFlowbased(PLAN, PLAN2 = PLAN3, country1 = "BE", country2 = "DE",
hubDrop = hubDrop, hubDrop2 = hubDrop2,
hours = c(3, 4), dates = c("2018-10-02"),
hours2 = c(3, 4), dates2 = c("2018-10-02"),
domainsNames = NULL, main = NULL,
color = c("blue", "grey", "green", "brown"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.