I'm following the instructions here Dummy variables from a string variable to try to convert a column of strings (words separated by spaces) into dummy variables (0-1 to indicate a word being notused/used in the string in that row) using concat.split.expanded but get a bunch of the below error:
In lapply(listOfValues, as.integer) : NAs introduced by coercion
preceded by one of
Error in seq.default(min(vec), max(vec)) : 'from' cannot be NA, NaN or infinite
I'm pretty sure there aren't any NAs in the column to be converted, let alone that many. Not sure how to go about fixing this. Thanks!
command I've been running that produces the problem:
concat.split.expanded(dataset, "stringvarname", sep = " ", mode = "binary", drop = false)
Produces the problem with or without fill=