epiforecasts / socialmixr

R package for deriving social mixing matrices from survey data.
http://epiforecasts.io/socialmixr/
Other
38 stars 11 forks source link

Survey reference can never include a version number #42

Closed Bisaloo closed 2 years ago

Bisaloo commented 2 years ago

Relevant code chunk:

https://github.com/epiforecasts/socialmixr/blob/b7afd5054a35c36d2e624158daf349249f650b6e/R/get_survey.r#L52-L60

reference is created with a given list of elements and names in L52-57. This list notably doesn't include "reference" so unless I'm missing something, the if branch on L58-60 can never be explored.

Is that supposed to be

-      if ("version" %in% names(reference)) { 
+      if ("version" %in% names(parsed_cite)) {
        reference[["note"]] <- paste("Version", parsed_cite$version)
      }

?

sbfnk commented 2 years ago

Is that supposed to be

Yes, I think that's exactly right