Skip to content

Commit

Permalink
update pj_estimate.R
Browse files Browse the repository at this point in the history
If researchers use make_projoint_data() from an already tidied tibble, they may not have an "agree" column (if they do not have a repeated task). Fixed the code to address this issue.
  • Loading branch information
yhoriuchi committed Aug 19, 2023
1 parent 1f2c03a commit 1b035e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions R/pj_estimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,13 @@ pj_estimate <- function(

# Keep the observations with both "selected" and "agree"

data_for_cov <- data_for_estimand %>%
filter(!is.na(agree))

if (is.null(irr)){
data_for_cov <- data_for_estimand %>%
dplyr::filter(!is.na(agree))
} else{
data_for_cov <- data_for_estimand
}

if (estimand == "mm"){

if (is.null(.irr)){
Expand Down
2 changes: 1 addition & 1 deletion man/projoint.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b035e7

Please sign in to comment.