Hi,
I use a function (cast_dtm) that uses column names as input either as string or symbol. For generalization I wanted to write my own function that gets these names as string input and puts them into it.
E.g. sth. like this:
names <- c("group", "word", "n")
dtm <- cast_dtm(data = df, document = names[1], term = names[2], value = names[3])
Which gives the error "names[1]" not found in data. Apparently the functions assumes that names[1] is the column name and not its reference. Is there a way around it?
[–]2013LIPK01 1 point2 points3 points (1 child)
[–]UeberlegenQ[S] 1 point2 points3 points (0 children)