Skip to content

Commit

Permalink
fix error for data frame input
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Jan 1, 2025
1 parent a65b355 commit 36539b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/ggalign.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ AlignGg <- ggproto("AlignGg", AlignProto,
))
}
design["nobs"] <- list(layout_nobs)

# we always add `.index` to align the observations
if (identical(length(dim(input_data)), 2L)) {
if (!is.data.frame(input_data) &&
vec_is(dim(input_data), integer(), size = 2L)) {
plot_data$.index <- vec_rep(
seq_len(NROW(input_data)),
NCOL(input_data)
Expand Down

0 comments on commit 36539b2

Please sign in to comment.