File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
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,25 @@ 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
183
x <- x [,,1 ]
177
- as_tibble(x )
184
+ if (vec_size(x ) > 1 ) {
185
+ x <- as_tibble(x )
186
+ } else {
187
+ x <- tibble :: as_tibble_row(x )
188
+ }
189
+ x
178
190
}
179
191
180
192
organize_nnet_prob <- function (x , object ) {
You can’t perform that action at this time.
0 commit comments