Learn R Programming

OasisR (version 2.0.0)

MCPlot: A function to plot the results of Monte Carlo simulations

Description

Plot of Monte Carlo simulations results. The function can be used in two ways: buy providing a MCTest object, using MCTest or a simulated distribution vector, a value and a name of the index

Usage

MCPlot(MCTest = NULL, var = 1, dens = NULL, ind = NULL, pval = NULL, indexname = 'Index', coldist = 'red', colind = 'blue', legend = T, legendpos = 'top', cex.legend = 1, bty = 'o')

Arguments

MCTest
- a MCTest object prodused with MCTest function to be tested (only one-group or multigroup indeces)
var
- the number of the group to be plot (if several groups are simulated)
dens
- a vector with the simulatated distribution of the index
ind
- index value
pval
- pseudo p-value
indexname
- a string with the name of the index
coldist
- color used to plot the simulated distribution
colind
- color used to plot the index
legend
- logical parameter, to control the legend's plots
legendpos
- a character string giving the legend's position: "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center".
cex.legend
- a numerical value giving the amount by which plotting text and symbols in legend should be magnified relative to the default.
bty
- a character string which determines the type of box of the legend. If bty is one of "o" (the default), "l", "7", "c", "u", or "]" the resulting box resembles the corresponding upper case letter. A value of "n" suppresses the box.

Value

A plot with Monte Carlo results

References

Tivadar M., Schaeffer Y, Torre A. and Bray F. (2014) OASIS - un Outil d'Analyse de la Segregation et des Inegalites Spatiales. Cybergeo : European Journal of Geography, GeOpenMod, document 699

See Also

MCTest

Examples

Run this code
x <- segdata@data[ ,1:2]
test <- MCTest (x, fun='ISMorrill', simtype = 'perm', spatobj = segdata)

MCPlot(test, cex.legend = 0.8)

MCPlot(dens = test$Distribution[1,], ind = test$Summary$ISMorrill[1], 
pval = test$Summary$P.Value[1], indexname = test$Index, cex.legend = 0.8)

Run the code above in your browser using DataLab