Skip to content

Commit

Permalink
Bug fix for strr_ghost when one property_ID has multiple host_IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
dwachsmuth committed Jun 8, 2024
1 parent 8adcd8a commit f752eba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/strr_ghost.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ strr_ghost <- function(
}
)

## Check private_room and entire_home arguments
## Check private_room and entire_home arguments ------------------------------

if (lt_flag) {

Expand All @@ -168,7 +168,7 @@ strr_ghost <- function(
}
}

## Process dates if multi_date is TRUE
## Process dates if multi_date is TRUE ---------------------------------------

if (multi_date) {

Expand Down Expand Up @@ -242,6 +242,11 @@ strr_ghost <- function(

# Remove invalid listings
property <- property[!is.na(host_ID)]

# Check for multiple host_IDs for one property_ID
if (nrow(dplyr::filter(
property, length(unique(host_ID)) > 1, .by = property_ID)) > 0) stop(
"Multiple host_IDs detected for a single property_ID")


## Filter rows ---------------------------------------------------------------
Expand Down

0 comments on commit f752eba

Please sign in to comment.