You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have a list of vectors as one of the elements in .l argument passed to cross_d, I get an error when the vectors are all of the same type.
Appears like the elements of a series of same-type vectors are getting appended together into one long vector during the process of simplifying to a data frame, which causes the error?
library(purrr)
to.cross1 <- list(x = c("apple", "banana"),
y = list(c("1", "2", "3"), c("a", "b")))
# error
cross_d(to.cross1)
# ------------------------------------------------------
to.cross2 <- list(x = c("apple", "banana"),
y = list(list("1", "2", "3"), list("a", "b")))
# working, but now y is a list of lists rather than a list of vectors
cross_d(to.cross2)
# ------------------------------------------------------
# just like first example, but with the two vectors in y being of different types
to.cross3 <- list(x = c("apple", "banana"),
y = list(c("1", "2", "3"), c(3.33, 5.55)))
# working, and y is a list of vectors
cross_d(to.cross3)
The text was updated successfully, but these errors were encountered:
This is a difficult problem because we're trying to be helpful and simplify lists of scalar vectors where possible. This doesn't always work out, hence the inconsistent (in appearance) results.
It feels like this problem is connected to the issue #256, i.e. we need a specification for the types of the transposed columns.
If I have a list of vectors as one of the elements in
.l
argument passed tocross_d
, I get an error when the vectors are all of the same type.Appears like the elements of a series of same-type vectors are getting appended together into one long vector during the process of simplifying to a data frame, which causes the error?
The text was updated successfully, but these errors were encountered: