Created
September 15, 2016 11:38
-
-
Save slarge/4a41b9cdca5a184591425d62ece4b140 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(dplyr) | |
tt <- read.csv("~/AreasEcoregionsStocks.csv", | |
stringsAsFactors = FALSE) | |
td <- tt %>% | |
select(StockCode, Ecoregion1_major, Ecoregion2_minor, Ecoregion3_more_minor) %>% | |
melt(id.vars = "StockCode") %>% | |
select(-variable) %>% | |
filter(value != 0) %>% | |
distinct() | |
write.csv(td, "~/git/StockCodeArea.csv", row.names = FALSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment