@@ -14,7 +14,14 @@ dflt_courier <- font_spec("Courier", 9, 1)
14
14
# '
15
15
# ' @export
16
16
# ' @name listing_methods
17
- print.listing_df <- function (x , widths = NULL , tf_wrap = FALSE , max_width = NULL , fontspec = NULL , col_gap = 3L , round_type = c(" iec" , " sas" ), ... ) {
17
+ print.listing_df <- function (x ,
18
+ widths = NULL ,
19
+ tf_wrap = FALSE ,
20
+ max_width = NULL ,
21
+ fontspec = NULL ,
22
+ col_gap = 3L ,
23
+ round_type = c(" iec" , " sas" ),
24
+ ... ) {
18
25
tryCatch({
19
26
cat(
20
27
toString(
@@ -42,7 +49,12 @@ print.listing_df <- function(x, widths = NULL, tf_wrap = FALSE, max_width = NULL
42
49
# ' @exportMethod toString
43
50
# ' @name listing_methods
44
51
# ' @aliases toString,listing_df-method
45
- setMethod ("toString ", "listing_df", function(x, widths = NULL, fontspec = NULL, col_gap = 3L, round_type = c("iec", "sas"), ...) {
52
+ setMethod ("toString ", "listing_df", function(x,
53
+ widths = NULL ,
54
+ fontspec = NULL ,
55
+ col_gap = 3L ,
56
+ round_type = c(" iec" , " sas" ),
57
+ ... ) {
46
58
toString(
47
59
matrix_form(x , fontspec = fontspec , col_gap = col_gap , round_type = round_type ),
48
60
fontspec = fontspec ,
@@ -95,7 +107,9 @@ format_colvector <- function(df, colnm, colvec = df[[colnm]], round_type = c("ie
95
107
# ' needed to render the elements of `vec` to width `max_width`.
96
108
# '
97
109
# ' @keywords internal
98
- setGeneric ("vec_nlines ", function(vec, max_width = NULL, fontspec = dflt_courier, round_type = c("iec", "sas")) standardGeneric("vec_nlines"))
110
+ setGeneric ("vec_nlines ", function(vec, max_width = NULL, fontspec = dflt_courier, round_type = c("iec", "sas")) {
111
+ standardGeneric(" vec_nlines" )
112
+ })
99
113
100
114
# ' @param vec (`vector`)\cr a vector.
101
115
# '
@@ -108,7 +122,8 @@ setMethod("vec_nlines", "ANY", function(vec, max_width = NULL, fontspec = dflt_c
108
122
# NB: flooring as it is used as <= (also in base::strwrap)
109
123
}
110
124
# in formatters for characters
111
- unlist(lapply(format_colvector(colvec = vec , round_type = round_type ), nlines , max_width = max_width , fontspec = fontspec ))
125
+ unlist(lapply(format_colvector(colvec = vec , round_type = round_type ), nlines ,
126
+ max_width = max_width , fontspec = fontspec ))
112
127
})
113
128
114
129
# # setMethod("vec_nlines", "character", function(vec, max_width = NULL) {
0 commit comments