I am trying to test example code for fuzzywuzzyR
, but I receive the error message:
Error in init$Extract(string = word, sequence_strings = choice, processor = PROC, : attempt to apply non-function.
I read a few things online that talked about having the correct version of python installed. When I check in R, mine says python 2.7. However, I am not familiar with python as I only use R. Do I need python for this? How can I change the version. An answer online said " As a quick fix, I changed the PATH variables to python 3.5 location and used pip to install Levenshtein and fuzzywuzzy. If R instance was running during this operation, then close and reopen R." But I don't know what this means - how do I change the PATH variable?
library(fuzzywuzzyR)
word = "new york jets"
choice = c("Atlanta Falcons", "New York Jets", "New York Giants", "Dallas Cowboys")
init_proc = FuzzUtils$new()
PROC = init_proc$Full_process
PROC1 = tolower
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
init <- FuzzExtract$new()
init$Extract(string = word, sequence_strings = choice, processor = PROC, scorer = SCOR)