File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1300,14 +1300,24 @@ faced <- function(txt, face = "plain") {
1300
1300
bold <- function (x ) paste(" <b>" , x , " </b>" )
1301
1301
italic <- function (x ) paste(" <i>" , x , " </i>" )
1302
1302
1303
+ # generic S3 method to allow for class specific implementations
1304
+ uniq <- function (x ){
1305
+ UseMethod(" uniq" , x )
1306
+ }
1307
+
1303
1308
# if a vector that has one unique value (ignoring missings), return that value
1304
- uniq <- function (x ) {
1309
+ uniq.default <- function (x ) {
1305
1310
u <- unique(x )
1306
1311
if (identical(u , NA ) || length(u ) == 0 ) return (u )
1307
1312
u <- u [! is.na(u )]
1308
1313
if (length(u ) == 1 ) u else x
1309
1314
}
1310
1315
1316
+ # if TeX object convert to character first
1317
+ uniq.TeX <- function (x ){
1318
+ print(uniq.default(as.character(x )))
1319
+ }
1320
+
1311
1321
# theme(strip.background) -> plotly.js rect shape
1312
1322
make_strip_rect <- function (xdom , ydom , theme , side = " top" ) {
1313
1323
rekt <- rect2shape(theme [[" strip.background" ]])
You can’t perform that action at this time.
0 commit comments