@@ -232,8 +232,9 @@ Layer <- ggproto("Layer", NULL,
232
232
nondata_cols <- check_nondata_cols(evaled )
233
233
if (length(nondata_cols ) > 0 ) {
234
234
msg <- paste0(
235
- " Aesthetics must be valid data columns. Problematic aesthetic(s): " , as_label(aesthetics [[nondata_cols ]]),
236
- " . Did you mistype the name of a data column or forget to add stat()?"
235
+ " Aesthetics must be valid data columns. Problematic aesthetic(s): " ,
236
+ paste0(vapply(nondata_cols , function (x ) {as_label(aesthetics [[x ]])}, character (1 )), collapse = " , " ),
237
+ " . \n Did you mistype the name of a data column or forget to add stat()?"
237
238
)
238
239
stop(msg , call. = FALSE )
239
240
}
@@ -294,8 +295,9 @@ Layer <- ggproto("Layer", NULL,
294
295
nondata_stat_cols <- check_nondata_cols(stat_data )
295
296
if (length(nondata_stat_cols ) > 0 ) {
296
297
msg <- paste0(
297
- " Aesthetics must be valid computed stats. Problematic aesthetic(s): " , as_label(aesthetics [[nondata_stat_cols ]]),
298
- " . Did you map your stat in the wrong layer?"
298
+ " Aesthetics must be valid computed stats. Problematic aesthetic(s): " ,
299
+ paste0(vapply(nondata_stat_cols , function (x ) {as_label(aesthetics [[x ]])}, character (1 )), collapse = " , " ),
300
+ " . \n Did you map your stat in the wrong layer?"
299
301
)
300
302
stop(msg , call. = FALSE )
301
303
}
0 commit comments