Comments (11)
Hi Kristina! Thank you for working on this today :) i think i took care of the merge conflicts. have a look at the file to make sure all looks ok!
Do you know how to update your branch BEFORE doing a pull request. Or the other option is that you can work directly in the repo if you want to do that. whatever you prefer. then you don't have to do a pull request. totally up to you how you'd like to work. Just say the word if you need further explanation! :)
i will look at the lesson tomorrow and see if i have ideas in terms of what to include.
i have the same question as you about the image vs plot. i know there are some differences in terms of how the axes render, etc... but maybe someone else knows more? pinging @jhollist @bbest ?? image vs plot anyone know how they differ?
from r-raster-vector-geospatial.
Note that when you look for help on plot (ie type ?plot
at the command prompt) and you already have the raster package already loaded (ie library(raster)
), then you're presented with help documentation on functions from two different packages:
Similarly with ?image
:
The graphics library is a base package, and raster an add-on. Following the links to documentation above, especially raster::image
yields the best summary of differences:
This is an implementation of a generic function in the graphics package. In most cases the
plot
function would be preferable because it produces a legend (and has some additional options).
from r-raster-vector-geospatial.
What @bbest said!
To add, plot
will handle colormaps (if they exist) and image
won't. There also can be a performance hit on image
if you are limiting the x or y axis. IMO, plot
is preferable and for this lesson in which we use raster
sticking with plot
makes the most sense.
from r-raster-vector-geospatial.
Thanks for all the helpful and prompt comments y'all!
@lwasser I definitely forgot to update my branch! I'm still getting used to the collaborative workflow in Github, which is why I would kind of prefer to do pull requests instead of changing the repo directly, if that's okay? This adds another step, but I can accept my pull requests myself so that it's not a hassle for anyone else.
@bbest and @jhollist My intuition was to just use plot for this lesson, so I'm glad you both seem to concur.
During the hackathon, we discussed whether or not to explain the difference between the base R plot and the raster plot functions during the lesson. Does that seem important/a good use of time to people? I'm starting to think it might be a good idea so that people aren't confused about the multiple options when they use ?plot
.
from r-raster-vector-geospatial.
@KristinaRiemer I think it is OK to mention this but more as an abstract concept, as we don't want to get into the details of OOP in R. I wouldn't be able to help too much with that anyway, as I don't know a whole lot. Plus from what I hear it is a bit of a mess.
I think you can say something about many functions (including plot) often have specific implementations written for specific packages. As long as you have the package loaded into the current session R will know which version of plot
to use. Perhaps we could show the error that occurs if you try to plot a raster
object without having raster
loaded up. Something like
rast_obj<-raster::raster("file.tif")
plot(rast_obj)
should do the trick and will return the "cannot coerce type 'S4' to vector of type 'double'" error. If they know about that it should hopefully server as reminder to library(raster)
.
from r-raster-vector-geospatial.
@jhollist That's about the level of detail we were thinking about, including trying to plot a raster with the base plot. As @brymz had brought up, it seems like something general that everyone who codes in R should be aware of.
I'll incorporate that into the lesson when I get a chance next week. Thanks!
from r-raster-vector-geospatial.
Thank you @KristinaRiemer - whatever work flow is good for you, is good for me! :) it will be useful to fork and work remotely to learn more about collaboration in git! Let me know if you run into any other issues. It's much easier to resolve merge conflicts using shell / command line. Very happy to walk you through some of the basics IF at some point you'd like to do that :) Thank you again for the help with this.
I'm going to have a look at the lessons again and will post another issue about plot vs ggplot2. I'm almost thinking it's worth introducing ggplot somewhere early in the workshop materials. But i want everyone's input on this! I get it's a very different syntax approach but it's also very powerful and efficient for mapping from what i can tell so far.
from r-raster-vector-geospatial.
Hi @KristinaRiemer ! a quick update!
I went through the plot rasters lesson and added a hill shade exercise at the end (overlaying one raster over another and adding transparency. See what you think and feel free to edit away!
http://data-lessons.github.io/NEON-R-Spatial-Raster/R/Plot-Rasters-In-R.R/
I thought that would be cool because then in lesson 02 (a new lesson) i added something on reprojection and used the same set of data and same plotting techniques HOWEER one of the hillshades is in the wrong projection. So it doesn't line up! It's a nice way to reinforce plotting in the following lesson but also introduce projection issues. Anyway - see what you think, when you have time!
from r-raster-vector-geospatial.
@lwasser I like the hill shade overlay added to this lesson. Where can I get the hill shade raster file? (I don't think it's in the figshare).
I'm wondering a bit about the use of "overlay" between lessons 01 and 03. In lesson 01, this means to put a raster on top of another visually, while in lesson 03 overlay means doing math using two rasters. This might be unnecessarily picky, but I could see how this might confuse participants.
from r-raster-vector-geospatial.
@KristinaRiemer totally not picky -- good point. It will be confusing.
Hmmm... language. what language should we use then to stack two rasters on top of each other like we do in the hillshade? Any ideas?
Also - the hillshade is in the most current figshare download! Thank you for noting this.
http://files.figshare.com/2434040/NEON_RemoteSensing.zip
from r-raster-vector-geospatial.
Is an image that represents multiple bands a 'composite' image? 'Stack' is also a potential good option.
from r-raster-vector-geospatial.
Related Issues (20)
- Update to the spatial packages lifecycle: migrate to use sf, terra, and stars HOT 6
- PROJ string datum warning with rgdal package HOT 2
- levels() needs an update
- Curriculum Advisory Committee Recommendations from 2022 Q1 Meeting (Help wanted!) HOT 6
- Workbench Beta Test HOT 23
- Stack of a multiband raster composite list (help needed!) HOT 1
- Episodes 6-11 Rendering Error HOT 3
- Incorrect use of coord_quickmap()
- Plot Lines by Attribute Challenge Extra Steps HOT 1
- ReadMe refers to Master branch
- Required Packages by Episode HOT 1
- Links to other episodes HOT 1
- Challenge vs Exercise HOT 1
- Update CONTRIBUTING.md to give the same instructions as are in README.md HOT 2
- Suggestion to update package cache HOT 2
- broken links in instructor notes.
- Question concerning Pull Requests HOT 3
- Ep 8 & 11: Not explicitly stated which CHM file is used in either episode
- Use EPSG codes instead of proj4strings HOT 1
- RDAL sunsetting Oct 2023 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r-raster-vector-geospatial.