Skip to content

Commit 46f4ad3

Browse files
author
Jon Jablonski
committed
removing irrelevent chunk of table. we'll deal with gdal etc under the h2.
1 parent b1c7756 commit 46f4ad3

2 files changed

Lines changed: 64 additions & 100 deletions

File tree

learners/images/01-rstudio.png

386 KB
Loading

learners/setup.md

Lines changed: 64 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -8,160 +8,135 @@ This workshop is designed to be run on your local machine. First, you will need
88

99
## Data
1010

11-
You can download all of the data used in this workshop by clicking
12-
[this download link](https://ndownloader.figshare.com/articles/2009586/versions/10). The file is 218.2 MB.
11+
You can download all of the data used in this workshop by clicking [this download link](https://ndownloader.figshare.com/articles/2009586/versions/10). The file is 218.2 MB.
1312

14-
Clicking the download link will automatically download all of the files to your default download directory as a single compressed
15-
(`.zip`) file. To expand this file, double click the folder icon in your file navigator application (for Macs, this is the Finder
16-
application).
13+
Clicking the download link will automatically download all of the files to your default download directory as a single compressed (`.zip`) file. To expand this file, double click the folder icon in your file navigator application (for Macs, this is the Finder application).
1714

1815
For a full description of the data used in this workshop see the [data page](instructors/data.md).
1916

2017
## Option A: Local Installation
2118

2219
### Software
23-
| Software | Install | Manual | Available for | Description |
24-
| -------- | ------- | ------ | --------------------- | ------------------------------------------------------------- |
25-
| [R](https://www.r-project.org) | [Link](https://cloud.r-project.org) | [Link](https://cloud.r-project.org) | Linux, MacOS | Software environment for statistical and scientific computing |
26-
| [RStudio](https://www.rstudio.com) | [Link](https://www.rstudio.com/products/rstudio/download/#download) | | Linux, MacOS | GUI for R |
27-
28-
29-
||We're pretty sure none of the below gunk is necessary anymore.|
30-
| -------- | ------- | ------ | --------------------- | ------------------------------------------------------------- |
31-
| [GDAL](https://www.gdal.org) | [Link](https://gdal.org/download.html) | [Link](https://gdal.org) | Linux, MacOS, Windows | Geospatial model for reading and writing a variety of formats |
32-
| [GEOS](https://trac.osgeo.org/geos) | [Link](https://trac.osgeo.org/geos) | [Link](https://geos.osgeo.org/doxygen/) | Linux, MacOS, Windows | Geometry models and operations |
33-
| [PROJ.4](https://proj4.org) | [Link](https://proj4.org/install.html) | [Link](https://proj4.org/index.html) | Linux, MacOS, Windows | Coordinate reference system transformations |
34-
| [UDUNITS](https://www.unidata.ucar.edu/software/udunits/) | [Link](https://www.unidata.ucar.edu/downloads/udunits/index.jsp) | [Link](https://www.unidata.ucar.edu/software/udunits/#documentation) | Linux, MacOS, Windows | Unit conversions |
3520

36-
We provide quick instructions below for installing the various software needed for this workshop. At points, they assume familiarity with the command line and with installation in general. As there are different operating systems and many different versions of operating systems and environments, these may not work on your computer. If an installation doesn't work for you, please refer to the installation instructions for that software listed in the table above.
21+
| Software | Install | Manual | Available for | Description |
22+
|----------|----------|----------|----------|---------------------------------|
23+
| [R](https://www.r-project.org) | [Link](https://cloud.r-project.org) | [Link](https://cloud.r-project.org) | Linux, MacOS | Software environment for statistical and scientific computing |
24+
| [RStudio](https://www.rstudio.com) | [Link](https://www.rstudio.com/products/rstudio/download/#download) | | Linux, MacOS | GUI for R |
25+
3726

3827

39-
:::::::::::::::: spoiler
28+
We provide quick instructions below for installing the various software needed for this workshop. At points, they assume familiarity with the command line and with installation in general. As there are different operating systems and many different versions of operating systems and environments, these may not work on your computer. If an installation doesn't work for you, please refer to the installation instructions for that software listed in the table above.
4029

30+
::: spoiler
4131
## Windows
4232

4333
To install the geospatial libraries, install the latest version [RTools](https://cran.r-project.org/bin/windows/Rtools/)
34+
:::
4435

45-
:::::::::::::::::::::::::
46-
47-
:::::::::::::::: spoiler
48-
36+
::: spoiler
4937
## macOS - Install with Packages (Beginner)
5038

5139
The simplest way to install these geospatial libraries is to install the latest version of [Kyng Chaos's pre-built package](https://www.kyngchaos.com/software/frameworks) for GDAL Complete. Be aware that several other libraries are also installed, including the UnixImageIO, SQLite3, and `NumPy`.
5240

5341
After downloading the package in the link above, you will need to double-click the cardbord box icon to complete the installation. Depending on your security settings, you may get an error message about "unidentified developers". You can enable the installation by following [these instructions](https://kb.wisc.edu/page.php?id=25443) for installing programs from unidentified developers.
42+
:::
5443

55-
:::::::::::::::::::::::::
56-
57-
:::::::::::::::: spoiler
58-
44+
::: spoiler
5945
## macOS - Install with Homebrew (Advanced)
6046

6147
Alternatively, participants who are comfortable with the command line can install the geospatial libraries individually using [homebrew](https://brew.sh):
6248

63-
```bash
49+
``` bash
6450
$ brew tap osgeo/osgeo4mac && brew tap --repair
6551
$ brew install proj
6652
$ brew install geos
6753
$ brew install gdal2
6854
```
55+
:::
6956

70-
:::::::::::::::::::::::::
71-
72-
:::::::::::::::: spoiler
73-
57+
::: spoiler
7458
## Linux
7559

7660
Steps for installing the geospatial libraries will vary based on which form of Linux you are using. These instructions are adapted from the [`sf` package's `README`](https://github.com/r-spatial/sf).
7761

7862
For **Ubuntu**:
7963

80-
```bash
64+
``` bash
8165
$ sudo add-apt-repository ppa:ubuntugis
8266
$ sudo apt-get update
8367
$ sudo apt-get install libgdal-dev libgeos-dev libproj-dev
8468
```
8569

8670
For **Fedora**:
8771

88-
```bash
72+
``` bash
8973
$ sudo dnf install gdal-devel proj-devel geos-devel
9074
```
9175

9276
For **Arch**:
9377

94-
```bash
78+
``` bash
9579
$ pacman -S gdal proj geos
9680
```
9781

9882
For **Debian**: The [rocker geospatial](https://github.com/rocker-org/geospatial) Dockerfiles may be helpful. Ubuntu Dockerfiles are found [here](https://github.com/r-spatial/sf/tree/master/inst/docker). These may be helpful to get an idea of the commands needed to install the necessary dependencies.
99-
100-
:::::::::::::::::::::::::
83+
:::
10184

10285
### UDUNITS
10386

10487
Linux users will have to install UDUNITS separately. Like the geospatial libraries discussed above, this is a dependency for the `R` package `sf`. Due to conflicts, it does not install properly on Linux machines when installed as part of the `sf` installation process. It is therefore necessary to install it using the command line ahead of time.
10588

106-
:::::::::::::::: spoiler
107-
89+
::: spoiler
10890
## Linux
10991

11092
Steps for installing the geospatial will vary based on which form of Linux you are using. These instructions are adapted from the [`sf` package's `README`](https://github.com/r-spatial/sf).
11193

11294
For **Ubuntu**:
11395

114-
```bash
96+
``` bash
11597
$ sudo apt-get install libudunits2-dev
11698
```
11799

118100
For **Fedora**:
119101

120-
```bash
102+
``` bash
121103
$ sudo dnf install udunits2-devel
122104
```
123105

124106
For **Arch**:
125107

126-
```bash
108+
``` bash
127109
$ pacaur/yaourt/whatever -S udunits
128110
```
129111

130112
For **Debian**:
131113

132-
```bash
114+
``` bash
133115
$ sudo apt-get install -y libudunits2-dev
134116
```
135-
136-
:::::::::::::::::::::::::
117+
:::
137118

138119
### R
139120

140121
Participants who do not already have `R` installed should download and install it.
141122

142-
:::::::::::::::: spoiler
143-
123+
::: spoiler
144124
## Windows
145125

146126
To install `R`, Windows users should select "Download R for Windows" from RStudio and CRAN's [cloud download page](https://cloud.r-project.org), which will automatically detect a CRAN mirror for you to use. Select the `base` subdirectory after choosing the Windows download page. A `.exe` executable file containing the necessary components of base R can be downloaded by clicking on "Download R 3.x.x for Windows".
127+
:::
147128

148-
:::::::::::::::::::::::::
149-
150-
:::::::::::::::: spoiler
151-
129+
::: spoiler
152130
## macOS
153131

154132
To install `R`, macOS users should select "Download R for (Mac) OS X" from RStudio and CRAN's [cloud download page](https://cloud.r-project.org), which will automatically detect a CRAN mirror for you to use. A `.pkg` file containing the necessary components of base R can be downloaded by clicking on the first available link (this will be the most recent), which will read `R-3.x.x.pkg`.
133+
:::
155134

156-
:::::::::::::::::::::::::
157-
158-
:::::::::::::::: spoiler
159-
135+
::: spoiler
160136
## Linux
161137

162138
To install `R`, Linux users should select "Download R for Linux" from RStudio and CRAN's [cloud download page](https://cloud.r-project.org), which will automatically detect a CRAN mirror for you to use. Instructions for a number of different Linux operating systems are available.
163-
164-
:::::::::::::::::::::::::
139+
:::
165140

166141
### RStudio
167142

@@ -171,29 +146,28 @@ RStudio is a GUI for using `R` that is available for Windows, macOS, and various
171146

172147
The following `R` packages are used in the various geospatial lessons.
173148

174-
- [`dplyr`](https://cran.r-project.org/package=dplyr)
175-
- [`ggplot2`](https://cran.r-project.org/package=ggplot2)
176-
- [`raster`](https://cran.r-project.org/package=raster)
177-
- [`rgdal`](https://cran.r-project.org/package=rgdal)
178-
- [`rasterVis`](https://cran.r-project.org/package=rasterVis)
179-
- [`remotes`](https://cran.r-project.org/package=remotes)
180-
- [`sf`](https://cran.r-project.org/package=sf)
149+
- [`dplyr`](https://cran.r-project.org/package=dplyr)
150+
- [`ggplot2`](https://cran.r-project.org/package=ggplot2)
151+
- [`raster`](https://cran.r-project.org/package=raster)
152+
- [`rgdal`](https://cran.r-project.org/package=rgdal)
153+
- [`rasterVis`](https://cran.r-project.org/package=rasterVis)
154+
- [`remotes`](https://cran.r-project.org/package=remotes)
155+
- [`sf`](https://cran.r-project.org/package=sf)
181156

182-
To install these packages in RStudio, do the following:
183-
1\. Open RStudio by double-clicking the RStudio application icon. You should see
184-
something like this:
157+
To install these packages in RStudio, do the following:\
158+
1. Open RStudio by double-clicking the RStudio application icon. You should see something like this:
185159

186-
![](/fig/01-rstudio.png){alt='RStudio layout'}
160+
![](images/01-rstudio.png){alt="RStudio layout"}
187161

188162
2\. Type the following into the console and hit enter.
189163

190-
```r
164+
``` r
191165
install.packages(c("dplyr", "ggplot2", "raster", "rgdal", "rasterVis", "sf"))
192166
```
193167

194168
You should see a status message starting with:
195169

196-
```output
170+
``` output
197171
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/dplyr_0.7.6.tgz'
198172
Content type 'application/x-gzip' length 5686536 bytes (5.4 MB)
199173
==================================================
@@ -207,7 +181,7 @@ downloaded 3.4 MB
207181

208182
When the installation is complete, you will see a status message like:
209183

210-
```output
184+
``` output
211185
The downloaded binary packages are in
212186
/var/folders/7g/r8_n81y534z0vy5hxc6dx1t00000gn/T//RtmpJECKXM/downloaded_packages
213187
```
@@ -222,24 +196,21 @@ This option involves downloading an Docker image that contains an installation o
222196

223197
Once up and running - you'll have full access to RStudio right from your browser:
224198

225-
![](/fig/docker.png){alt='RStudio layout in browser showing similarity to desktop layout'}
199+
![](/fig/docker.png){alt="RStudio layout in browser showing similarity to desktop layout"}
226200

227201
Please be aware that the `R` package `rasterVis` is not included in the `rocker/geospatial` Docker image. If your instructor teaches with this package then you will need to install this `R` package yourself. All other `R` packages will already be installed for you.
228202

229-
:::::::::::::::: spoiler
230-
203+
::: spoiler
231204
## Downloading and Installing Docker Community Edition
232205

233206
To get started with Docker, download the [Docker Community Edition](https://www.docker.com/community-edition) from [Docker's store](https://store.docker.com/search?type=edition&offering=community). Community editions are available for [Windows](https://store.docker.com/editions/community/docker-ce-desktop-windows), [macOS](https://store.docker.com/editions/community/docker-ce-desktop-mac), and Linux operating systems including [Debian](https://store.docker.com/editions/community/docker-ce-server-debian), [Fedora](https://store.docker.com/editions/community/docker-ce-server-fedora), and [Ubuntu](https://store.docker.com/editions/community/docker-ce-server-ubuntu).
234207

235208
The download pages for each of these operating systems contain notes about some necessary system requirements and other pre-requisites. Once you download the installer and follow the on-screen prompts.
236209

237210
Additional installation notes are available in Docker's documentation for each of these operating systems: [Windows](https://docs.docker.com/docker-for-windows/install/), [macOS](https://docs.docker.com/docker-for-mac/install/), [Debian](https://docs.docker.com/install/linux/docker-ce/debian/), [Fedora](https://docs.docker.com/install/linux/docker-ce/fedora/), and [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/).
211+
:::
238212

239-
:::::::::::::::::::::::::
240-
241-
:::::::::::::::: spoiler
242-
213+
::: spoiler
243214
## Using the `rocker/geospatial` Docker Image via the Command Line
244215

245216
#### Download and Set-up
@@ -248,23 +219,23 @@ Once Docker is installed and up and running, you will need to open your computer
248219

249220
You need to have already installed Docker Community Edition (see instructions above) before proceeding. Once you have Docker downloaded and installed, make sure Docker is running and then enter the following command into the terminal to download the `rocker/geospatial` image:
250221

251-
```bash
222+
``` bash
252223
$ docker pull rocker/geospatial
253224
```
254225

255226
Once the pull command is executed, the image needs to be run to become accessible as a container. In the following example, the image is named `rocker/geospatial` and the container is named `gis`. The [image](https://docs.docker.com/glossary/?term=image) contains the software you've downloaded, and the [container](https://docs.docker.com/glossary/?term=container) is the run-time instance of that image. New Docker users should need only one named container per image.
256227

257228
When `docker run` is used, you can specify a folder on your computer to become accessible inside your RStudio Server instance. The following `docker run` command exposes Jane's `GitHub` directory to RStudio Server. Enter the file path where your workshop resources and data are stored:
258229

259-
```bash
230+
``` bash
260231
$ docker run -d -P --name gis -v /Users/jane/GitHub:/home/rstudio/GitHub -e PASSWORD=mypass rocker/geospatial
261232
```
262233

263234
When she opens her RStudio instance below, she will see a `GitHub` folder in her file tab in the lower righthand corner of the screen. Windows and Linux users will have to adapt the file path above to follow the standards of their operating systems. More details are available on [rocker's Wiki](https://github.com/rocker-org/rocker/wiki/Sharing-files-with-host-machine).
264235

265236
The last step before launching your container in a browser is to identify the port that your Docker container is running in:
266237

267-
```bash
238+
``` bash
268239
$ docker port gis
269240
```
270241

@@ -274,30 +245,28 @@ An output, for example, of `8787/tcp -> 0.0.0.0:32768` would indicate that you s
274245

275246
When you are done with a Docker session, make sure all of your files are saved locally on your computer **before closing your browser and Docker**. Once you have ensured all of your files are available (they should be saved at the file path designated in `docker run` above), you can stop your Docker container in the terminal:
276247

277-
```bash
248+
``` bash
278249
$ docker stop gis
279250
```
280251

281252
#### Re-starting a Container
282253

283254
Once a container has been named and created, you cannot create a container with the same name again using `docker run`. Instead, you can restart it:
284255

285-
```bash
256+
``` bash
286257
$ docker start gis
287258
```
288259

289260
If you cannot remember the name of the container you created, you can use the following command to print a list of all named containers:
290261

291-
```bash
262+
``` bash
292263
$ docker ps -a
293264
```
294265

295266
If you are returning to a session after stopping Docker itself, make sure Docker is running again before re-starting your container!
267+
:::
296268

297-
:::::::::::::::::::::::::
298-
299-
:::::::::::::::: spoiler
300-
269+
::: spoiler
301270
## Using the `rocker/geospatial` Docker Image via Kitematic
302271

303272
#### Download and Install Kitematic
@@ -327,37 +296,32 @@ Paste that url into your browser and, if prompted, enter `rstudio` for both the
327296
When you are done with a Docker session, make sure all of your files are saved locally on your computer **before closing your browser and Docker**. Once you have ensured all of your files are available (they should be saved at the file path designated in `docker run` above), you can stop your Docker container by clicking on the `Stop` icon in Kitematic's toolbar.
328297

329298
You can restart your container later by clicking the `Restart` button.
299+
:::
330300

331-
:::::::::::::::::::::::::
332-
333-
:::::::::::::::: spoiler
334-
301+
::: spoiler
335302
## Managing Docker Containers and Images
336303

337304
To obtain a list of all of your current Docker containers:
338305

339-
```bash
306+
``` bash
340307
$ docker ps -a
341308
```
342309

343310
To list all of the currently downloaded Docker images:
344311

345-
```bash
312+
``` bash
346313
$ docker images -a
347314
```
348315

349316
These images can take up system resources, and if you'd like to remove them, you can use the `docker prune` command. To remove any Docker resources not affiliated with a container listed under `docker ps -a`:
350317

351-
```bash
318+
``` bash
352319
$ docker system prune
353320
```
354321

355322
To remove **all** Docker resources, including currently named containers:
356323

357-
```bash
324+
``` bash
358325
$ docker system prune -a
359326
```
360-
361-
:::::::::::::::::::::::::
362-
363-
327+
:::

0 commit comments

Comments
 (0)