Description Usage Arguments Details Value Examples
m_scatter
generates a matrix of pairwise scatter plots to graphically
investigate possible associations between variables.
1 2 3 4 5 6 7 8 9 10 11 12 |
data |
The output from |
data_type |
The type of input data. Possible options are 'dat', 'yr' or 'run' |
lookup |
A table to add relevant variable matched using the scenarios names |
yr |
The year to be plotted |
popn |
The sequential number of the population (in integer) |
param |
The parameter to be plotted in the last raw |
vs |
The parameters to be plotted |
save2disk |
Whether to save the output to disk, default: TRUE |
fname |
The name of the files where to save the output |
dir_out |
The local path to store the output. Default: Plots |
The output from collate_dat
is the preferred input for this function
as large datasets will require a long time to be plotted.
It may be convenient to pass the dependent variable of a regression model
with param
so that all the pairwise scatter plots of this variable
will be in one line.
A matrix of scatter plots
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Using Pacioni et al. example data. See ?pac.lhs for more details.
data(pac.lhs)
# Remove base scenario
pac.lhs.no.base <- pac.lhs[!pac.lhs$scen.name == 'ST_LHS(Base)', ]
# Get correct parameter values at year 0
lkup.ST_LHS <- lookup_table(
data=pac.lhs.no.base, project='Pacioni_et_al',
scenario='ST_LHS',
pop='Population 1',
SVs=c('SV1', 'SV2', 'SV3', 'SV4', 'SV5', 'SV6', 'SV7'),
save2disk=FALSE)
scatter.plot <- m_scatter(
data=pac.lhs.no.base[1:33],
data_type='dat',
lookup=lkup.ST_LHS,
yr=120,
popn=1,
param='Nall',
vs=c('SV1', 'SV2', 'SV3'),
save2disk=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.