Skip to content

Commit

Permalink
Update kmeans-funcs.R
Browse files Browse the repository at this point in the history
  • Loading branch information
spsanderson committed Apr 25, 2022
1 parent f36f1f3 commit fa5b7ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/kmeans-funcs.R
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,12 @@ kmeans_tidy_tbl <- function(.kmeans_obj, .data, .tidy_type = "tidy") {
stop(call. = FALSE, "(.user_item_data) is not a data.frame/tibble, please supply original user item tibble.")
}

if (!class(kmeans_obj) == "kmeans") {
if (!inherits(x = kmeans_obj, what = "kmeans")){
stop(call. = FALSE, "(.kmeans_obj) is not of class 'kmeans'")
}
# if (!class(kmeans_obj) == "kmeans") {
# stop(call. = FALSE, "(.kmeans_obj) is not of class 'kmeans'")
# }

if (!tidy_type %in% c("tidy", "augment", "glance")) {
stop(call. = FALSE,
Expand Down

0 comments on commit fa5b7ca

Please sign in to comment.