The map() function in the purrr package throws an error when passed a list to convert to dfms. The error appears whether the input is a list of characters or corpora.
a <- "a"
b <- "b"
c <- list(a, b)
map(c, dfm)
# Error in if (who_called_me_first(sys.calls(), "dfm") == "corpus") { :
missing value where TRUE/FALSE needed
a <- corpus("a")
b <- corpus("b")
c <- list(a, b)
map(c, dfm)
# Error in if (who_called_me_first(sys.calls(), "dfm") == "corpus") { :
missing value where TRUE/FALSE needed
This issue does not occur with other quanteda functions, e.g. corpus().
a <- "a"
b <- "b"
c <- list(a, b)
map(c, corpus)
# [[1]]
# Corpus consisting of 1 document and 0 docvars.
# [[2]]
# Corpus consisting of 1 document and 0 docvars.
The map() function in the purrr package throws an error when passed a list to convert to dfms. The error appears whether the input is a list of characters or corpora.
This issue does not occur with other quanteda functions, e.g. corpus().