Skip to content

Commit ffb7f9a

Browse files
authored
Merge pull request #63 from ehrlinger/copilot_refactor
Fix model label assignment in gg_partial function for categorical data
2 parents ab286b9 + ec1ce49 commit ffb7f9a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

R/gg_partial.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ gg_partial <- function(part_dta,
104104
}
105105
## Optionally attach a model label (useful when overlaying multiple forests)
106106
if (!is.null(model)) {
107-
continuous$model <- categorical$model <- model
107+
continuous$model <- model
108+
if(!is.null(categorical) && nrow(categorical) > 0) {
109+
categorical$model <- model
110+
}
108111
}
109112

110113
return(list(continuous = continuous, categorical = categorical))

0 commit comments

Comments
 (0)