AFSD | R Documentation |
This function performs the analysis of a simple method introduced by Nelson (1996) and expanded by Laranjeira et al. (1998). The function assumes the dataframe supplied as input has columns 'x', 'y', and 'i', where 'x' and 'y' are spatial coordinates and 'i' is a disease indicator variable (1 if diseased, otherwise 0). The function performs several steps including filtering rows where 'i' is 1, converting to an adjacency matrix, and creating foci using igraph. It then calculates various statistics about the foci and returns these in a list.
AFSD(df)
df |
A dataframe containing at least three columns: 'x', 'y', and 'i'. 'x' and 'y' represent spatial coordinates and 'i' is a disease indicator (1 if diseased, otherwise 0). |
A list containing: cluster_summary2: a dataframe summarizing the number and size of foci, and proportions of diseased plants. cluster_df: a dataframe containing foci information, including size and number of rows and columns in each foci. df_clustered: the original dataframe with an added 'focus_id' column, showing which foci each row belongs to.
Other Spatial analysis:
BPL()
,
count_subareas()
,
count_subareas_random()
,
fit_gradients()
,
join_count()
,
oruns_test()
,
oruns_test_boustrophedon()
,
oruns_test_byrowcol()
,
plot_AFSD()
# Generate a sample dataframe
set.seed(123)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.