mardi 24 juillet 2018

If Statement, do function, say statement

I am trying to write a simple if statement. For some reason, I keep getting the same error "the condition has length > 1 and only the first element will be used".

Basically trying to do this:

if(data$type == "Not Classified") {sapply(data$description, colcheck)} else "Not Classified"

The colcheck is a function created previously. I have tried IfElse, taking out the "else" at the end, adding a "do" in front of the function, but they aren't working. I am trying to filter the data to only use the function on the rows that the type = "Not classified". Thank you

Aucun commentaire:

Enregistrer un commentaire