plot_AFSD | R Documentation |
This function creates a tile plot of the foci (cluster) identified by the AFSD function. It colors each cell in a foci and labels the centroid of each cluster with the foci ID. The 'ggplot2' package is used for the plot, and will be automatically installed if not already present.
plot_AFSD(df)
df |
A dataframe containing at least three columns: 'x', 'y', and 'cluster_id'. 'x' and 'y' are spatial coordinates and 'cluster_id' is the cluster identifier to which each cell belongs. |
A ggplot object with the scatter plot of foci (clusters).
Other Spatial analysis:
AFSD()
,
BPL()
,
count_subareas()
,
count_subareas_random()
,
fit_gradients()
,
join_count()
,
oruns_test()
,
oruns_test_boustrophedon()
,
oruns_test_byrowcol()
df <- data.frame(x = sample(1:100, 500, replace = TRUE),
y = sample(1:100, 500, replace = TRUE),
i = sample(0:1, 500, replace = TRUE, prob = c(0.7, 0.3)))
# Perform the AFSD
result <- AFSD(df)
# Plot the foci
plot_AFSD(result[[3]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.