Skip to content

Commit

Permalink
no names for AsIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Dec 14, 2024
1 parent 2a9358c commit 3e505b5
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions R/align-link.R
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,25 @@ AlignLinkProto <- ggproto("AlignLinkProto", AlignGg,
if (!is.waive(x <- .subset2(params, self$arg))) {
if (!is.list(x)) x <- list(x)
params[[self$arg]] <- lapply(x, function(link) {
ans <- vec_as_location(
unclass(link),
n = nobs,
names = self$labels,
missing = "error",
arg = self$arg,
call = self$call
)
if (inherits(link, "AsIs")) ans <- I(ans)
if (inherits(link, "AsIs")) { # cannot use character
ans <- vec_as_location(
link,
n = nobs,
missing = "error",
arg = self$arg,
call = self$call
)
ans <- I(ans)
} else {
ans <- vec_as_location(
unclass(link),
n = nobs,
names = self$labels,
missing = "error",
arg = self$arg,
call = self$call
)
}
ans
})
}
Expand Down

0 comments on commit 3e505b5

Please sign in to comment.