File tree 2 files changed +13
-5
lines changed 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 8
8
9
9
* Added an ` outside ` option to ` annotation_logticks() ` that places tick marks
10
10
outside of the plot bounds. (#3783 , @kbodwin )
11
+
12
+ * Data columns can now contain ` Vector ` S4 objects, which are widely used in the
13
+ Bioconductor project. (@teunbrand , #3837 )
11
14
12
15
# ggplot2 3.3.0
13
16
Original file line number Diff line number Diff line change @@ -285,11 +285,16 @@ is.discrete <- function(x) {
285
285
is.factor(x ) || is.character(x ) || is.logical(x )
286
286
}
287
287
288
- # This function checks that all columns of a dataframe `x` are data and
289
- # returns the names of any columns that are not.
290
- # We define "data" as atomic types or lists, not functions or otherwise
288
+ # This function checks that all columns of a dataframe `x` are data and returns
289
+ # the names of any columns that are not.
290
+ # We define "data" as atomic types or lists, not functions or otherwise.
291
+ # The `inherits(x, "Vector")` check is for checking S4 classes from Bioconductor
292
+ # and wether they can be expected to follow behavior typical of vectors. See
293
+ # also #3835
291
294
check_nondata_cols <- function (x ) {
292
- idx <- (vapply(x , function (x ) is.null(x ) || rlang :: is_vector(x ), logical (1 )))
295
+ idx <- (vapply(x , function (x ) {
296
+ is.null(x ) || rlang :: is_vector(x ) || inherits(x , " Vector" )
297
+ }, logical (1 )))
293
298
names(x )[which(! idx )]
294
299
}
295
300
379
384
# Check inputs with tibble but allow column vectors (see #2609 and #2374)
380
385
as_gg_data_frame <- function (x ) {
381
386
x <- lapply(x , validate_column_vec )
382
- new_data_frame(tibble :: as_tibble( x ) )
387
+ new_data_frame(x )
383
388
}
384
389
validate_column_vec <- function (x ) {
385
390
if (is_column_vec(x )) {
You can’t perform that action at this time.
0 commit comments