studyGroup icon indicating copy to clipboard operation
studyGroup copied to clipboard

R Utility Belt Module: Spatial Analysis

Open bkatiemills opened this issue 9 years ago • 13 comments

Soo, forking from #29, here are some ideas for things to include in a spatial analysis module:

  • rgeos
  • rgdal
  • maptools
  • rastor
  • sp
  • intro to GIS (thanks @remi-daigle )

The idea, to recap also from #29, being to offer the core list in that issue, and then mix in these 5 lessons for a semester-long series of meetups with a GIS / spacial mapping flavor. I'll ask here as there:

  • Would anyone like to point to or create lessons on these topics?
  • Would anyone like to deliver them at Study Group?
  • Anything topics we missed / topics that can be combined into one / topics that should cover more than a single session?

cc @stephhazlitt @remi-daigle @ateucher

bkatiemills avatar Jun 26 '15 20:06 bkatiemills

OK, after giving this a bit of thought, I think the spatial lessons should be organized by tasks as opposed to package because you honestly can't do very much with just one of these packages in isolation. I usually use 3-4 packages at once as a team. I propose the following as potential lesson topics:

  • Introduction to GIS/mapping in R
    • Importing and basic plotting of shapefiles (ArcGIS) into R
    • Spatial data types in R
    • Creation of spatial objects
  • Projections and distances
    • Playing with different projection types
    • Measuring distances (and how that's affected by projection)
  • Queryable spatial databases and data manipulation
    • maps::map (basic map of countries)
    • raster::getData (states and provinces, higher resolution)
    • marmap::getNOAA.bathy() (bathymetry from NOAA)
    • manipulation of spatialpolygondataframes
  • Advanced plotting
    • heatmaps
    • contour maps
    • others?
  • Advanced spatial manipulations
    • rgeos::gBuffer, gContains, and gOverlaps
    • network analysis (e.g. spdep::tri2nb)

So I guess that's 5 potential lessons that I think would bring people from having done zero GIS in R up to GIS wiz in a pretty short amount of time. If anyone has thoughts on the structure, content, or any other suggestions I'm all ears!

I'm sure I'll end up doing at the very least one of these, but I also don't see myself doing all of these in my short time at SFU (I leave at the end of August), and I'm more than willing to provide feedback or help in any way I can if anyone else wants to volunteer themselves for one or more lessons. Any takers? cc @stephhazlitt @ateucher

remi-daigle avatar Jun 30 '15 23:06 remi-daigle

Remi, this is what I've been looking forward to! Unfortunately for me, I'm in the field July-August. Can you recommend any other resources that cover these topics? Thanks!

dsemeniuk avatar Jun 30 '15 23:06 dsemeniuk

Hey Dave! Sadly I don't know of any such resources, it took alot of googling/digging to learn these topics in the first place. This is exactly why I'm motivated to get these lessons done! I can't speak for the others but anything I produce won't be limited to the study group(s), my plan is to make a github page for each of my lessons (e.g. http://remi-daigle.github.io/tidyr_reshape2_lesson/).

@BillMills is there a distribution plan for the R Utility Belt beyond individual github pages?

remi-daigle avatar Jun 30 '15 23:06 remi-daigle

Excellent! Looking forward to digging in to the material. On a side note, how would you compare R with Ocean Data View's capacity/ease of use for creating maps and representing spatial data?

dsemeniuk avatar Jun 30 '15 23:06 dsemeniuk

I haven't used ODV extensively, but it's a hard comparison to make. ODV is a graphical user interface based program while R is decidedly not, so there's a learning curve issue. If you're starting from scratch for both, you will produce your first plot in ODV orders of magnitude faster. If you're a heavy R user, you might still produce the first plot faster in ODV, but if you're producing 100 plots, you'll get that done in R faster.

Also, there is a flexibility issue as with any GUI based software, if you want to do something there is no click box for, you're screwed, but with R, you can always hard code exactly what you need if there is no pre-made package.

So I guess, R wins on capacity (although ODV I'm sure is still quite capable), for ease of use ODV wins if you're only making a couple plots and will never revise them (which never happens!)

PS: I just remembered I have some introductory spatial things in my tutorial I made for the Intertidal Ecology class I taught at Dal: https://github.com/remi-daigle/R_tutorial_ocean lesson 2 might have some useful stuff for you to "tide you over" while we get these lessons done

remi-daigle avatar Jul 01 '15 00:07 remi-daigle

@remi-daigle +1 on organizing by topic over package - as long as the lessons fit into one-hour sessions, that's what matters most for Study Groups.

For the Utility Belts more broadly, I'd like to make them as usable for as many different groups (Study or otherwise) as possible; that's part of why I want to split the material into the generic belt, and topic-specific add-ons like this one. Packaging them as independent repos is (IMO) a great way to keep them remixable - people can pick and choose the lessons they want, and fork them to do their own thing with them if they like. Think of them as a loose federation of resources, optimized for sharing & reuse.

bkatiemills avatar Jul 02 '15 00:07 bkatiemills

Hi all! I heard of this initiative from colleagues at SESYNC / UMD, and just wanted to mention I would be interested to contribute in developing this module. Earlier this summer we ran a ~90 min intro to geospatial analysis in R (https://github.com/SESYNC-ci/CSI-2015/blob/master/Lessons/R/geospatial.md) . It ended up being just enough time to introduce the spatial data types (sp package), importing and creating spatial objects, and visualizing them with both standard plot and ggplot.

Rémi's outline sounds like an excellent plan, and I would only suggest one small addition, to mention the geosphere package to create and measure geodesic lines (that would probably fit best in the projections and distances lesson).

pmarchand1 avatar Aug 04 '15 19:08 pmarchand1

Hi @pmarchand1 - that's fantastic, thanks for the link! I'm going to include that in the Study Group list of lessons right away. As for developing this module, I'd love your help with this - the best way to get involved, is to lead a session covering one of the units @remi-daigle described above, put the lesson plan in a GitHub repo somewhere, and let us know how it went. I know UMD has been running awesome co-working sessions lately, but maybe @knilsen would help arrange a demo session if you're leading. Let me know how it goes!

bkatiemills avatar Aug 04 '15 20:08 bkatiemills

The UMD group is looking to do demo sessions/presentations once the semester gets going; we'd love to have you lead one @pmarchand1! Do get in touch.

gauravsk avatar Aug 05 '15 15:08 gauravsk

Hey @pmarchand1 That's excellent stuff! Sounds like you have some great ideas for a "projections and distances" lesson. I didn't know about the geosphere package, but that sounds like it would fit perfectly in that lesson. Would you like to take the lead on developing a lesson on that stuff? I can assist as much or as little as needed, just let me know.

I've started an introductory lesson similar to yours: https://github.com/remi-daigle/GIS_mapping_in_R/blob/master/GIS_mapping_in_R.R but I haven't finished it yet since it looks like I will be moving away from my current study group before I get a chance to deliver the lesson. @BillMills I'm moving to Acadia University at the end of August and I've been approached by some of my colleagues there about a) running a software carpentry workshop and b) starting a study group (probably R centric), they are now gauging if there is broad enough interest to get these started, but if so, I'd love to chat with you about it.

Either way, I will eventually find an audience for my into lesson since I move every ~4 months. I'd also love to tackle the "Queryable spatial databases and data manipulation" afterwards

remi-daigle avatar Aug 06 '15 21:08 remi-daigle

@remi-daigle sounds good, I am always available for this; I recommend throwing a SWC workshop to get everyone out and together for the first time, then carrying on with regular Study Group meetups. Let me know anything I can do to help organize one or both!

bkatiemills avatar Aug 07 '15 00:08 bkatiemills

Hey all, I'm leading a study group on introductory GIS in R tomorrow at the new study group at Acadia University, here's my lesson material

remi-daigle avatar Sep 25 '15 01:09 remi-daigle

@remi-daigle awesome! I've added your lesson to this utility belt, the central Study Group lesson repo, and the Handbook - thanks, let us know how it goes!

bkatiemills avatar Sep 25 '15 02:09 bkatiemills