# Example usage of simulate_data
if (FALSE) {
set.seed(123) # For reproducibility
simulated_data <- simulate_data(
n_accounts_coord = 100,
n_accounts_noncoord = 50,
n_objects = 20,
min_participation = 2,
time_window = 10
)
# Extract input
input_data <- simulated_data[[1]]
# Extract output and keep coordinated actors.
# This is expected correspond to CooRTweet results from `detect_group`
simulated_results <- simulated_data[[2]]
simulated_results <- simulated_results[simulated_results$coordinated == TRUE, ]
simulated_results$coordinated <- NULL
# Run CooRTweet using the input_data and the parameters used for simulation
results <- detect_groups(
x = input_data,
time_window = 10,
min_participation = 2
)
# Sort data tables and check whether they are identical
data.table::setkeyv(simulated_results, names(simulated_results))
data.table::setkeyv(results, names(simulated_results))
identical(results, simulated_results)
}
Run the code above in your browser using DataLab