File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -283,4 +283,5 @@ importFrom(utils,getFromNamespace)
283
283
importFrom(utils,globalVariables)
284
284
importFrom(utils,head)
285
285
importFrom(utils,methods)
286
+ importFrom(vctrs,vec_size)
286
287
importFrom(vctrs,vec_unique)
Original file line number Diff line number Diff line change @@ -168,13 +168,24 @@ check_args.multinom_reg <- function(object) {
168
168
169
169
# ------------------------------------------------------------------------------
170
170
171
+ # ' @importFrom vctrs vec_size
171
172
organize_multnet_class <- function (x , object ) {
172
- x [,1 ]
173
+ if (vec_size(x ) > 1 ) {
174
+ x <- x [,1 ]
175
+ } else {
176
+ x <- as.character(x )
177
+ }
178
+ x
173
179
}
174
180
181
+ # ' @importFrom vctrs vec_size
175
182
organize_multnet_prob <- function (x , object ) {
176
- x <- x [,,1 ]
177
- as_tibble(x )
183
+ if (vec_size(x ) > 1 ) {
184
+ x <- as_tibble(x [,,1 ])
185
+ } else {
186
+ x <- tibble :: as_tibble_row(x [,,1 ])
187
+ }
188
+ x
178
189
}
179
190
180
191
organize_nnet_prob <- function (x , object ) {
You can’t perform that action at this time.
0 commit comments