Closed vinfalardeau closed 3 years ago
On second thought, probably not important – looks like I saved the old version of the map, and this step isn't needed for the figure 4 comparison.
I'm wondering if one of the case_when
results is NULL
in your data?
It also may not be necessary to run this code chunk again, since it's just creating features for cartography that are the same across all of the maps? If it has already been run, then you can use the existing EA
data frame. Sometimes re-running older code chunks when the data objects already exist can cause trouble, because the chunks are based on assumptions that the data is in an older state...
BTW if you need to scrap a data object and recreate it, in the console the command rm(EA)
deletes/removes the EA data.
Thanks, using rm() for all the inputs and then reloading them without some intermediate steps did the trick!
The trouble is that when I've closed and reopened my R Project, the global environment comes up empty, which is odd because in my experience an .Rproj file usually stores everything in the environment. So anything that I hadn't written to a file (such as the EA data frame), I needed to restore by re-running code. I think I must have either added a step in the code that threw off one of the inputs, or else I forgot to run a necessary snippet somewhere, but all's well now.
I'm not sure what's going on, but I was able to make a map in R last week, and now I'm running into an error in the section that makes a layer for national parks, reserves, and lakes (in the "r misc. map features" code chunk). What I'm trying to run is this:
The error seems to be that there are 256 Traditional Authorities, but only 255 features in the ea data frame prior to the mutate step:
Maybe one of the TA features is entirely outside of the livelihood zones, so it gets clipped out and cannot be pushed into the case_when statement? I've been stuck on this line of code for a while, trying to recreate the map I had earlier, so I might just resort to doing it in QGIS