# Section 2.1 if (!require("vdmR")) { install.packages("vdmR") library("vdmR") } data("vsfuk2012", package = "vdmR") head(vsfuk2012[, 1:5]) # Section 2.2 vscat(MortalityRate, FertilityRate, vsfuk2012, "scat01", "vsfuk2012") vhist(MarriageRate, vsfuk2012, "hist01", "vsfuk2012") try(tools::startDynamicHelp(FALSE)) vlaunch(vsfuk2012, "main", "vsfuk2012") try(tools::startDynamicHelp(FALSE)) vlaunch(vsfuk2012, "main", "vsfuk2012", iframe = TRUE) # Section 3.2 vscat(MortalityRate, FertilityRate, vsfuk2012, "scat01", "vsfuk2012", color = Type, size = pop_male) try(tools::startDynamicHelp(FALSE)) vlaunch(vsfuk2012, "main", "vsfuk2012") vscat(MortalityRate, FertilityRate, vsfuk2012, "scat01", "vsfuk2012", color = I("darkgreen"), size = pop_male) try(tools::startDynamicHelp(FALSE)) vlaunch(vsfuk2012, "main", "vsfuk2012") # Section 3.3 vhist(MarriageRate, vsfuk2012, "hist01", "vsfuk2012", fill = I("darkgreen"), color = I("black")) try(tools::startDynamicHelp(FALSE)) vlaunch(vsfuk2012, "main", "vsfuk2012") # Section 3.4 vpcp(vsfuk2012, 4:17, "pcp1", "vsfuk2012", groupColumn = "Type", scale = "uniminmax", missing = "min10") try(tools::startDynamicHelp(FALSE)) vlaunch(vsfuk2012, "main", "vsfuk2012") vpcp(vsfuk2012, 4:17, "pcp1", "vsfuk2012", alphaLines = 0.1, scale = "uniminmax", missing = "min10") try(tools::startDynamicHelp(FALSE)) vlaunch(vsfuk2012, "main", "vsfuk2012") # Section 3.5 library("maptools") shp.path <- file.path(system.file(package = "vdmR"), "etc/shapes/fukuoka2012.shp") vsfuk2012.spdf <- readShapeSpatial(shp.path, IDvar = "CityCode") head(vsfuk2012.spdf@data) library("ggplot2") frcol <- scale_fill_gradient2(low = "blue", mid = "white", high = "red", midpoint = median(vsfuk2012$FertilityRate)) vcmap(shp.path, vsfuk2012, "CityCode", "CityCode", "map1", "vsfuk2012", fill = FertilityRate, ggscale = frcol) try(tools::startDynamicHelp(FALSE)) vlaunch(vsfuk2012, "main", "vsfuk2012")