Last active
November 14, 2017 09:39
-
-
Save verajosemanuel/190b712d546349d76df16c6c336a5afd to your computer and use it in GitHub Desktop.
matching and merging #df in #R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grades <- c(1, 2, 2, 3, 1) | |
info <- data.frame( | |
grade = 3:1, | |
desc = c("Excellent", "Good", "Poor"), | |
fail = c(F, F, T) | |
) | |
# info table with grades | |
id <- match(grades, info$grade) | |
info[id, ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment