Skip to content

Commit 9e67b94

Browse files
authored
revert 5657, instead explicitly restore AsIs (#5683)
1 parent 0e4394d commit 9e67b94

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

R/geom-.R

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,16 @@ Geom <- ggproto("Geom",
172172

173173
# Override mappings with params
174174
aes_params <- intersect(self$aesthetics(), names(params))
175-
check_aesthetics(params[aes_params], nrow(data))
176-
vec_cbind(data[setdiff(names(data), aes_params)], !!!params[aes_params])
175+
new_params <- params[aes_params]
176+
check_aesthetics(new_params, nrow(data))
177+
data[aes_params] <- new_params
178+
179+
# Restore any AsIs classes (#5656)
180+
is_asis <- which(vapply(new_params, inherits, what = "AsIs", logical(1)))
181+
for (i in aes_params[is_asis]) {
182+
data[[i]] <- I(data[[i]])
183+
}
184+
data
177185
},
178186

179187
# Most parameters for the geom are taken automatically from draw_panel() or

0 commit comments

Comments
 (0)