Learn R Programming

OpenRepGrid (version 0.1.12)

orderByString: find the order of a string vector so it will match the order of another

Description

find the order of a string vector so it will match the order of another

Usage

orderByString(x, y)

Arguments

x

a vector of strings

y

a vector of strings

Value

a vector of strings

Examples

Run this code
# NOT RUN {
   a <- c("c", "a", "b")
   b <- c("b", "c", "a")
   index <- orderByString(a, b)    # to order b like a needs what indexes?
   index
   b[index]
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab