Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurs when questioned documents folder contains multiple docs from the same writer #157

Closed
stephaniereinders opened this issue Jun 26, 2024 · 0 comments · Fixed by #167

Comments

@stephaniereinders
Copy link
Member

If the folder main_dir > data > questioned_docs contains more than one document from the same writer analyze_questioned_documents() produces an error. I started looking into the bug. The problem starts in the following lines of cluster_analysis.R:

qwriters <- unique(questioned_data$graph_measurements$writer)
  
  # list known writers
  kwriters <- unique(model$graph_measurements$writer)

  # obtain posterior samples of model parameters
  message("Obtaining likelihood evaluations...")
  likelihood_evals <- foreach::foreach(d = 1:nrow(questioned_data$cluster_fill_counts)) %dopar% { # d is document
    # filter docs for current writer
    qdoc2 <- questioned_data$graph_measurements %>% dplyr::filter(writer == qwriters[d])

If, for example, there are two questioned documents from the same writer, qwriters is a vector of length 1. Then in the second iteration of the foreach loop when d=2, qwriters[d] produces NA instead of the writer ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant