Open dcarver1 opened 4 years ago
Hi @dcarver1, you might be interested in previous discussion of tmap
in #133 and links therein. Personally, I favor a ggplot
only approach because it means that only one tool needs to be explained and ggplot
has more "brand" recognition outside the spatial community. I do agree with your point however that ggplot
plotting of raster
objects is a bit clunky.
I'm working through these lessons in preparation for teaching an upcoming workshop and want to second the opinion that ggplot2 is the wrong choice for much of this material, for the following reasons:
raster::plot()
without issue.plot()
saves so much time teaching.plot()
, and I'd argue it would be challenging to make something like this in ggplot: https://ebird.org/science/status-and-trends/woothr. plot() is good for the whole spectrum, from exploratory maps to publication quality maps.@jsta if your daily work, if you load a raster for the first time and want to quickly visualize it to see what you're dealing with, do you actually go to the trouble of typing all the ggplot syntax?
For context, I'll say that I'm a diehard Tidyverse/ggplot fan in almost all scenarios, and I do often use it for vector data, but despite that I don't think it's the way to go for raster plotting. I also agree with @jsta that adding a new tool (tmap) is problematic, so why not use raster::plot()
. Perhaps ggplot for the plotting specific lessons making "pretty" maps, but sub in plot()
for other lessons when you just want a quick exploratory map.
To be clear, I'm just referring to raster data here, vector plotting is a different story.
True, I rarely type out the ggplot syntax for rasters in my daily work. My goto is actually mapview
for interactive work.
My opinion is that we should leave the written lesson material in ggplot but individual instructors can sub-out or supplement the ggplot code with raster::plot()
on the fly in the workshop itself. However I don't have strong feelings about this.
One sticking point I see is how to handle lesson 11, which combines vector and raster layers, if we drop ggplot for rasters but don't drop ggplot for vector layers.
Hello, I appreciated the direction and overall need for this lesson, but as I was working through, I couldn't help but think to myself that this was a lot of flipping rasters to data frames and building out ggplot statements. I understand the utility of ggplot, and it should be a core part of this lesson. Yet, in my workflows with spatial data in R, I rely heavily on the library tmap and the function qtm to provide quick visual checks of the data.
For example, lesson 4 we plot a df derived from a raster with the following code
We could send a few less minutes typing (these ggplot elements are used later in the lesson) and use a single line as this is just for visualization purposes.
Yes, we loose some controll and visualization techniques, but I just don't think we need to worry about the color gradiaent or the legend name in cases where we just want to see what we are working with.
Again, for me, this all comes back to wanting to spend more time talking about spatial data and less time typing out ggplot statements. This may be outside the framework of the lesson, but I'm curious what others think about it.