Cleanup: started with a shapefile that had: - broken geometries - polygons that had the same IDlong, which I wanted to be multipart polygons - edited au to au_agg, which is the dataset to use for all future analyses.
library(sp) library(rgdal) library(maps) library(maptools) library(sf) library(rgeos) #devtools::install_github("eblondel/cleangeo") library(cleangeo) library(devtools) library(githubinstall) install_github("roopakrithi/AUdata2018", build_vignettes = F) fl <- system.file("extdata/", package = "AUdata2018") dat <- read.csv(paste0(fl, "au_data.csv")) dat <- as.data.frame(dat, stringsAsFactors = F) #au <- readOGR(dsn = paste0(fl, "au.shp"), layer = "au") #names(au) au <- readOGR(dsn = paste0(fl, "au3.shp"), layer = "au3") names(au3) au <- merge(au, dat, by.x = "IDlong", by.y = "IDlong") # FIX BROKEN GEOM gIsValid(au) ## FALSE report <- clgeo_CollectionReport(au) clgeo_SummaryReport(report) au <- clgeo_Clean(au) report.clean <- clgeo_CollectionReport(au) clgeo_SummaryReport(au) gIsValid(au) ## make polygons with same IDlong into multipart polygons au <- aggregate(au, by = list(au$IDlong), FUN = mean) # this worked, but it made all text into NAs. so re-merging with dat. au_agg <- au[, "IDlong"] writeOGR(au_agg, dsn = "~/Desktop/Himachal_data/AUdata2018/inst/extdata", layer = "au_agg", driver = "ESRI Shapefile", overwrite_layer = TRUE)
check aux data
fl2 <- "~/Desktop/Himachal_data/AUdata2018/inst/SCRATCH/" rivers_roads <- readOGR(dsn = paste0(fl2, "rivers_roads.shp"), layer = "rivers_roads") settlements <- readOGR(dsn = paste0(fl2, "settlements.shp"), layer = "settlements") writeOGR(rivers_roads, dsn = "~/Desktop/Himachal_data/AUdata2018/inst/extdata", layer = "rivers_roads", driver = "ESRI Shapefile", overwrite_layer = TRUE) writeOGR(settlements, dsn = "~/Desktop/Himachal_data/AUdata2018/inst/extdata", layer = "settlements", driver = "ESRI Shapefile", overwrite_layer = TRUE)
Start looking at the data:
dat[is.na(dat)] <- 0 ## be careful, there are a few variables where NA =/= 0
A few new variables
# squared travel time dat$tt2 <- (dat$travel.time)^2 # visible from village OR major thoroughfare dat$vis.any <- 0 #don't actually need this dat$vis.any <- ifelse(( dat$vis.settl == 1 | dat$vis.other == 1), 1, 0) # visual check: #cbind(dat$vis.settl, dat$vis.other, dat$vis.any) # higest severity for any species dat$max.threat <- apply(dat[,c("monkey.threat", "boar.threat", "ung.threat", "other.threat" )], 1, max) # visual check: cbind(dat$monkey.threat, dat$boar.threat, dat$ung.threat, dat$max.threat) names(dat)
Some exploratory stuff by village: boxplots/histograms for: + travel time, area, bar graphs for + trend.area, trend.cashcrops, livelhood dependence, threat levels, any shared protection
#install.packages("colorspace") library(colorspace) vnames <- c("Gr", "BB", "Dh", "Sp", "Ra", "Su", "Ro") par(mfrow = c(1,1), mar = c(1, 1, 1, 1), oma = c(3, 2, 2, 0)) # travel time to AU, by village boxplot(dat$travel.time ~ dat$villageID, las = 1, boxwex= .8, names = vnames, main = "Travel time to AU") # area by village boxplot(dat$AU.area ~ dat$villageID, las = 1, boxwex= .8, names = vnames, main = "AU area") table(dat$village) ## set up villages ## for loop: for each village, plot x par(mfrow = c(1,1)) barplot(table(dat$max.threat, dat$village), col=c("black", "lightgrey", "yellow", "orange", "red", "darkred") , border="white", space=0.04, font.axis=2, xlab="village") legend("topright", legend = c(5:0), fill= c("darkred", "red", "orange", "yellow", "lightgrey", "black"), bty = "n")
HWC draws attention to spatial patterns of crop losses to wildlife, and also suggest that areas of high HWC are prone to abandonment. However few studies evaluate how this works in relation to farmers' individual and collective management decisions about crop selection and crop protection. My case study will hopefuly show that similar to previous studies threat is highest near forests and abandonment is also higher near forests, agricultural land in high threat areas also collectively managed by local communities to reduce potential losses. These patterns produce dynamic land use patterns that are responsive to wildlife pressures. While these trends are particularly strong in communities with long, vibrant histories of collective action, I find that even in areas which have not had a strong tradition of collectively managing crops to prevent wildlife-related losses, collective systems are continuously evolving to leverage local and state resources to effectively reduce losses]. These findings suggest that (1) for policy interventions targetting communities facing wildlife threats, it is important to continue to develop not just individual-scale solutions (such as compensation schemes targetting individual households) but also look toward interventions that can work with existing or emergent collective structures, and (2) while the literature primarily focuses on land use change (particularly forest/habitat loss) as a driver of human wildlife conflict, it it worth noting that wildlife also have significant impacts on farmer choices and land cover outcomes. Further, AUs that are more central and further from forests are more intensively farmed, while more distant areas are used more extensively, producing a dynamic zone of interaction. research is required to evaluate how feedbacks between wildlife depredation of crops and farmers' individual and collective decisions about agriculture are mediated through dynamic land use change at fine spatial scales.
Break this down:
For threat level: - this is a likert-like scale, so I'll have to use ordinal regression. I could combine the categories, but I actually want to avoid doing that beucase I think there are important differences between 4 and 5.
Is there more abandonment near these features? Is there more abandonment in areas identified as having higher threat levels?
But... Do areas with more threat also have more collective action? What else explains AUs with collective management?
also expect this to be related to (following from CA lit), a larger number of people using it, and more people who are ag dependent.
but... how do relationships with wildlife impact land use patterns? I STILL DON'T KNOW WHAT QUESTIONS TO ASK HERE?
What are the land use outcomes I'm interested in? cash crops, area sown, what crops are planted, often were there fallows (maybe)
I expect that areas with high but not severe threat have over time been less intensively used, less area used, and more abandonment.
Old LMs, delete later
lm1 <- lm(pc.cropped.summer ~ travel.time + borders.forest + borders.water + vis.settl, data = aus) summary(lm1) aus$tt2 <- (au$travel.time)^2 lm2 <- lm(pc.cropped.summer ~ travel.time + tt2 + borders.forest + borders.water + vis.settl + as.factor(subr) , data = aus[1:125,]) summary(lm2) lm3 <- lm(pc.cropped.summer ~ travel.time + borders.forest + borders.water + vis.settl , data = aus[c(1:80,100:125),]) lm4 <- lm(inactive.pc ~ travel.time + borders.forest + borders.water + vis.settl , data = aus[c(1:80,100:125),]) summary(lm4) lm5 <- lm(inactive.pc ~ travel.time + borders.forest + borders.water + AU.hh, data = aus[(1:80,),]) summary(lm5) lm6 <- lm(monkey.threat ~ travel.time + borders.forest + borders.water + borders.settl , data = aus[1:99,]) summary(aus) hist(aus) #Ask tim how to account for different villages/regions.
** these findings suggest a few different mechanisms of land change: - people stop farming, or farm less, in areas that are further away because they are less convenient, and, particularly as this is also correlated with les dependence on agriculture as a primary livelihood, convenience is a major driver of abandonment. this is generally in keeping with theories about deagrarianiation. - another explanation is that people farm less in areas that are difficult to protect. difficulty may be in the form of areas that are hard to monitor passively because they are less visible from settled areas or areas of high traffic; conveneience plays a part here too...
point being, I think there's a policy angle here. a number of different mechanisms can drive similar land use patterns, including economic drivers and wildife-depredation management optimization.
So based on these initial findings, I want to try to understand (1) what the different possible mechanisms are that could explain observed patterns of land change, and (2) how different policy interventions would potentially impact long-term outcomes. this is NOT what I set out to do. but think about it a bit...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.