plot.rflexscan | R Documentation |
Display detected clusters by a graph representation.
## S3 method for class 'rflexscan' plot( x, rank = 1:length(x$cluster), pval = 1, vertexsize = max(x$input$coordinates[, 1]) - min(x$input$coordinates[, 1]), xlab = colnames(x$input$coordinates)[1], ylab = colnames(x$input$coordinates)[2], xlim = c(min(x$input$coordinates[, 1]), max(x$input$coordinates[, 1])), ylim = c(min(x$input$coordinates[, 2]), max(x$input$coordinates[, 2])), col = palette(), frame_color = "gray40", vertex_color = "white", ... )
x |
An rflexscan object. |
rank |
An integer vector which specifies ranks of clusters to be displayed. |
pval |
A threshold of P-value. Clusters with P-values of < |
vertexsize |
Size of vertex of the graph. |
xlab |
A label of the x axis. |
ylab |
A label of the y axis. |
xlim |
The x limits of the plot. |
ylim |
The y limits of the plot. |
col |
A vector of colors for each cluster. |
frame_color |
Color of frames in the graph. |
vertex_color |
Fill color of vertices that are not included in any clusters. |
... |
Other parameters to be passed to plot.igraph function. |
Clusters are colored using the current palette. Please use palette function to specify colors of each cluster. Note that clusters with ranks larger than the number of colors in the palette are not highlighted.
rflexscan
# load sample data (North Carolina SIDS data) library(spdep) data("nc.sids") # calculate the expected numbers of cases expected <- nc.sids$BIR74 * sum(nc.sids$SID74) / sum(nc.sids$BIR74) # run FleXScan fls <- rflexscan(x = nc.sids$x, y = nc.sids$y, observed = nc.sids$SID74, expected = expected, name = rownames(nc.sids), clustersize = 10, nb = ncCR85.nb) # display all clusters plot(fls) # display clusters with rank 1, 2 and 3 plot(fls, rank = c(1, 2, 3)) # display clusters of P-value <= 0.05 plot(fls, pval = 0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.