Last active
November 25, 2015 17:34
-
-
Save dgrtwo/d9e30155531799d3e984 to your computer and use it in GitHub Desktop.
This file contains 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
library(readr) | |
library(dplyr) | |
start <- read_delim("col3 col2 col4 col1 | |
h a t t | |
i v i g | |
k s g n | |
n g n i", delim = " ") | |
start %>% | |
slice(c(1, 3, 2, 4)) %>% | |
select(col1, col3, col2) | |
### puzzle 2: | |
start2 <- read_delim("col3 col2 col4 col1 | |
h b t t | |
i w i g | |
k t g n | |
n h n i", delim = " ") | |
# missing "a", "s", and "v", gotta use mutate: | |
start2 %>% | |
slice(c(1, 3, 2, 4)) %>% | |
select(col1, col3, col2) %>% | |
mutate(col2 = c("a", "s", "v", "g")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment