cloudyr / MTurkR

R Client for the MTurk Requester API
https://cloud.r-project.org/package=MTurkR
91 stars 18 forks source link

Change factor to character in GenerateQualificationRequirement #121

Closed anonresearcher closed 5 years ago

anonresearcher commented 7 years ago

This is a minor enhancement. I was having a little problem with the GenerateQualificationRequirement function when I try to feed in many parameters.

qual <- CreateQualificationType(name="Already completed HIT",
                                description="Already completed identical HIT before.",
                                status = "Active")
qreq2 <- GenerateQualificationRequirement(c("Locale","Approved",
 as.character(qual$QualificationTypeId)),  # how I fixed the problem
                                         c("==", ">", "DoesNotExist"), 
                                         c("US", 85, ""), preview = TRUE)

qual$QualificationTypeId was a factor and that was getting me problems. It works when I changed it to character instead. Maybe qual$QualificationTypeId should be a character by default?