@@ -56,8 +56,8 @@ paginate_listing <- function(lsting,
56
56
tf_wrap = ! is.null(max_width ),
57
57
max_width = NULL ,
58
58
verbose = FALSE ) {
59
+ # process lists of listings
59
60
if (! is(lsting , " listing_df" )) {
60
- # process lists of listings
61
61
checkmate :: assert_true(all(unlist(lapply(lsting , is , " listing_df" ))))
62
62
if (! " colwidths" %in% as.list(match.call())) {
63
63
all_colwidths <- lapply(lsting , propose_column_widths )
@@ -72,58 +72,58 @@ paginate_listing <- function(lsting,
72
72
)
73
73
74
74
ret <- unlist(lsting_list , recursive = FALSE )
75
- ret
76
- } else {
77
- checkmate :: assert_flag(tf_wrap )
78
- checkmate :: assert_count(max_width , null.ok = TRUE )
79
- checkmate :: assert_flag(verbose )
80
- checkmate :: assert_class(lsting , " listing_df" )
81
- checkmate :: assert_numeric(colwidths , lower = 0 , len = length(listing_dispcols(lsting )), null.ok = TRUE )
75
+ return (ret )
76
+ }
82
77
83
- indx <- paginate_indices(lsting ,
84
- page_type = page_type ,
85
- font_family = font_family ,
86
- font_size = font_size ,
87
- lineheight = lineheight ,
88
- landscape = landscape ,
89
- pg_width = pg_width ,
90
- pg_height = pg_height ,
91
- margins = margins ,
92
- lpp = lpp ,
93
- cpp = cpp ,
94
- colwidths = colwidths ,
95
- tf_wrap = tf_wrap ,
96
- max_width = max_width ,
97
- rep_cols = length(get_keycols(lsting )),
98
- verbose = verbose
99
- )
78
+ checkmate :: assert_flag(tf_wrap )
79
+ checkmate :: assert_count(max_width , null.ok = TRUE )
80
+ checkmate :: assert_flag(verbose )
81
+ checkmate :: assert_class(lsting , " listing_df" )
82
+ checkmate :: assert_numeric(colwidths , lower = 0 , len = length(listing_dispcols(lsting )), null.ok = TRUE )
100
83
101
- vert_pags <- lapply(
102
- indx $ pag_row_indices ,
103
- function (ii ) lsting [ii , ]
104
- )
105
- dispnames <- listing_dispcols(lsting )
106
- full_pag <- lapply(
107
- vert_pags ,
108
- function (onepag ) {
109
- if (! is.null(indx $ pag_col_indices )) {
110
- lapply(
111
- indx $ pag_col_indices ,
112
- function (jj ) {
113
- res <- onepag [, dispnames [jj ], drop = FALSE ]
114
- listing_dispcols(res ) <- intersect(dispnames , names(res ))
115
- res
116
- }
117
- )
118
- } else {
119
- list (onepag )
120
- }
84
+ indx <- paginate_indices(lsting ,
85
+ page_type = page_type ,
86
+ font_family = font_family ,
87
+ font_size = font_size ,
88
+ lineheight = lineheight ,
89
+ landscape = landscape ,
90
+ pg_width = pg_width ,
91
+ pg_height = pg_height ,
92
+ margins = margins ,
93
+ lpp = lpp ,
94
+ cpp = cpp ,
95
+ colwidths = colwidths ,
96
+ tf_wrap = tf_wrap ,
97
+ max_width = max_width ,
98
+ rep_cols = length(get_keycols(lsting )),
99
+ verbose = verbose
100
+ )
101
+
102
+ vert_pags <- lapply(
103
+ indx $ pag_row_indices ,
104
+ function (ii ) lsting [ii , ]
105
+ )
106
+ dispnames <- listing_dispcols(lsting )
107
+ full_pag <- lapply(
108
+ vert_pags ,
109
+ function (onepag ) {
110
+ if (! is.null(indx $ pag_col_indices )) {
111
+ lapply(
112
+ indx $ pag_col_indices ,
113
+ function (jj ) {
114
+ res <- onepag [, dispnames [jj ], drop = FALSE ]
115
+ listing_dispcols(res ) <- intersect(dispnames , names(res ))
116
+ res
117
+ }
118
+ )
119
+ } else {
120
+ list (onepag )
121
121
}
122
- )
122
+ }
123
+ )
123
124
124
- ret <- unlist(full_pag , recursive = FALSE )
125
- ret
126
- }
125
+ ret <- unlist(full_pag , recursive = FALSE )
126
+ ret
127
127
}
128
128
129
129
# ' @title Defunct functions
0 commit comments