SyntaxFix
Write A Post
Hire A Developer
Questions
If you don't want to use any libraries and you have reoccurrences in your data, you can use which with sapply as well.
which
sapply
new_order <- sapply(target, function(x,df){which(df$name == x)}, df=df) df <- df[new_order,]