Skip to content

Commit

Permalink
more reference references correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Nov 19, 2024
1 parent 57dc93c commit 9d78c5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/as_contact_survey.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ as_contact_survey <- function(x, id.column = "part_id",
assert_names(names(x), must.include = c("participants", "contacts"))
assert_data_frame(x$participants)
assert_data_frame(x$contacts)
assert_list(reference, names = "named", null.ok = TRUE)
assert_list(x$reference, names = "named", null.ok = TRUE)
assert_character(id.column)
assert_character(year.column, null.ok = TRUE)
assert_character(country.column, null.ok = TRUE)
Expand Down Expand Up @@ -59,11 +59,11 @@ as_contact_survey <- function(x, id.column = "part_id",
}
})

if (is.null(reference)) {
if (is.null(x$reference)) {
warning("No reference provided")
}

survey <- new_contact_survey(x$participant, x$contacts, reference)
survey <- new_contact_survey(x$participant, x$contacts, x$reference)
survey <- clean(survey)

return(survey)
Expand Down

0 comments on commit 9d78c5e

Please sign in to comment.