BorderData07 <- read_csv("Downloads/BorderData/BorderApprehension2007.csv")
BorderData08 <- read_csv("Downloads/BorderData/BorderApprehension2008.csv")
BorderData07[is.na(BorderData07)] = 0
B08[is.na(B08)] = 0
BorderData07$CITIZENSHIP <- str_to_title(BorderData07$CITIZENSHIP)
BorderData07$Region <- countrycode(sourcevar = BorderData07$CITIZENSHIP, origin = "country.name", destination = "region")
BorderData07[nrow(BorderData07), 26] <- "Total"
World_Region <- ddply(BorderData07,"Region",numcolwise(sum))
ggplot(World_Region, aes(x = Region, y = Total)) + geom_col(width = 0.5, position = position_dodge(3), fill = 'blue', alpha = 0.5) + scale_y_log10() + coord_flip() + geom_text(aes(label=Total), alpha = 1.0, check_overlap = TRUE) + ggtitle("Apprehension By World Region Totals in 2007")
I'm trying to use lapply to run through each csv file for every year of my border data. The only difference from each one is the ending of the csv file and the title of the graph. My knowledge of lapply is super limited and am having trouble learning how to get it to function properly.