Skip to content

Commit

Permalink
Merge branch 'main' into post-feedback-update-lesson-4
Browse files Browse the repository at this point in the history
  • Loading branch information
cforgaci committed May 15, 2024
2 parents b5f51fa + 60bd8aa commit 59f5f68
Show file tree
Hide file tree
Showing 20 changed files with 721 additions and 538 deletions.
Binary file removed .DS_Store
Binary file not shown.
59 changes: 59 additions & 0 deletions .github/workflows/workshop-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# A workflow for testing the workshop setup in different operating systems

name: Test Workshop Setup

# Controls when the action will run. Workflow runs when manually triggered using the UI
on:
workflow_dispatch:

jobs:
workshop_setup:
runs-on: ${{matrix.os}}
strategy:
matrix:
# list of Os's
R: ['4.3.3']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{matrix.R}}
rtools-version: '43'
- run: Rscript -e 'print("R was installed successfully")'
- name: Install GDAL, GEOS, and PROJ.4 (macOS)
if: matrix.os == 'macos-latest'
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew tap osgeo/osgeo4mac && brew tap --repair
brew install proj
brew install geos
brew install gdal
shell: bash
- name: Install GDAL, GEOS, and PROJ.4 (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo add-apt-repository ppa:ubuntugis -y
sudo apt-get update
sudo apt-get install libgdal-dev libgeos-dev libproj-dev -y
shell: bash
# Include Fedora and Arch?
- name: UDUNITS
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install libudunits2-dev -y
shell: bash
- name: Geospatial Packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
packages: |
any::sessioninfo
any::tidyverse
any::terra
any::sf
- name: Test Lessons
run: |
Rscript -e 'nc <- sf::st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE); if (sf::st_crs(sf::st_transform(nc, 4326))$epsg == 4326) print("`sf` works as expected"); if (nrow(dplyr::filter(nc, AREA > 0.2)) == 11) print("`tidyverse` works as expected")'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ renv/sandbox/

# Mac OS X files
.DS_Store
episodes/.DS_Store
71 changes: 71 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Geospatial Data Carpentry for Urbanism
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Claudiu
family-names: Forgaci
email: [email protected]
affiliation: Delft University of Technology
orcid: 'https://orcid.org/0000-0003-3218-5102'
- given-names: Clémentine
family-names: Cottineau
email: [email protected]
affiliation: Delft University of Technology
orcid: 'https://orcid.org/0000-0002-2452-3901'
- given-names: Kyri Maaike Joey
family-names: Janssen
email: [email protected]
affiliation: Delft University of Technology
orcid: 'https://orcid.org/0000-0002-4606-9332'
- given-names: Jérôme
family-names: Francisco Conceicao
email: [email protected]
affiliation: Delft University of Technology
orcid: 'https://orcid.org/0000-0002-7023-5636'
- given-names: Manuel Garcia
family-names: Alvarez
email: [email protected]
affiliation: Delft University of Technology
- given-names: Ana
family-names: Petrović
email: [email protected]
affiliation: Delft University of Technology
- given-names: Selin
family-names: Kubilay
email: [email protected]
orcid: 'https://orcid.org/0009-0002-5263-1333'
affiliation: Delft University of Technology
- given-names: Daniele
family-names: Cannatella
email: [email protected]
affiliation: Delft University of Technology
orcid: 'https://orcid.org/0000-0003-1810-2032'
- given-names: 'Javier '
orcid: 'https://orcid.org/0000-0002-8369-556X'
family-names: San Millán Tejedor
email: [email protected]
affiliation: Delft University of Technology
- given-names: Aleksandra
family-names: Wilczynska
affiliation: 4TU.ResearchData
- name: Rbanism Community
city: Delft
country: NL
website: 'https://rbanism.org'
repository-code: >-
https://github.com/carpentries-incubator/r-geospatial-urban
url: >-
https://carpentries-incubator.github.io/r-geospatial-urban/
keywords:
- r
- geospatial-data
- lesson
- urban-data-science
- carpentries
license: CC-BY-4.0
103 changes: 28 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,103 +1,56 @@
# Geospatial Data Carpentry for Urbanism

This lesson is a template lesson that uses [The Carpentries Workbench][workbench].

## Lesson Description

This lesson is an introduction to working with raster and vector data in R for
researchers in urbanism or related fields. After a brief introduction to R, it
focuses on vector and raster data and their use in practical GIS operations on
urban datasets.

## Rendered Version of This Lesson

Version 1.0

## Contact Information

[Rbanism Community](mailto:rbanism@tudelf.nl)
[Rbanism Community](mailto:rbanism@tudelft.nl)

## Contributing Information

Please see the [CONTRIBUTING page](https://github.com/carpentries-incubator/r-geospatial-urban/blob/main/CONTRIBUTING.md) for guidance on how to contribute to this lessom.
Please see the [CONTRIBUTING page](https://github.com/carpentries-incubator/r-geospatial-urban/blob/main/CONTRIBUTING.md) for guidance on how to contribute to this lesson.

## Credits / Acknowledgements

- [Daniele Cannatella](https://github.com/dcannatella)
- [Clémentine Cottineau](https://github.com/ClementineCttn)
This lesson was developed by:

- [Claudiu Forgaci](https://github.com/cforgaci)
- [Clémentine Cottineau](https://github.com/ClementineCttn)
- [Aleksandra Wilczynska](https://github.com/alwil)
- [Ana Petrovic](https://github.com/ana-5r)
- [Daniele Cannatella](https://github.com/dcannatella)
- [Javier San Millán Tejedor](https://github.com/javisanmillan)
- [Jerome Francisco Conceicao](https://github.com/fcjerome)
- [Manuel Garcia](https://github.com/manuGil)
- [Kyri Janssen](https://github.com/KyriJanssen)
- [Manuel Garcia](https://github.com/manuGil)
- [Selin Kubilay](https://github.com/Selkubi)
- [Ana Petrovic](https://github.com/ana-5r)
- [Javier San Millán Tejedor](https://github.com/javisanmillan)
- [Aleksandra Wilczynska](https://github.com/alwil)

## Citation
Large parts of the lesson were adapted from:

## License
- Jemma Stachelek, Serah Njambi, Mike Mahoney, sheila, Andrea T. Thomaz, Annajiat Alim Rasel, David Pérez-Suárez, Erika Koontz, Joe Molloy, Jon Jablonski, Juan Fung, Katrin Leinweber, Matthew Sisk, Richard Detomasi, Sarah LR Stevens, Shamar Stewart, Susan Chen, & Wartini Ng. (2023). datacarpentry/r-intro-geospatial: Introduction to R for Geospatial Data 2023-05 (2023.05). Zenodo. https://doi.org/10.5281/zenodo.7897052

The R Geospatial Urban lesson, like most other software provided by The Carpentries, are made available under the OSI-approved MIT license. Please see the [LICENSE page](https://github.com/carpentries-incubator/r-geospatial-urban/blob/main/LICENSE.md) for further information.
- Jemma Stachelek, & Kunal Marwaha. (2023). datacarpentry/organization-geospatial: Data Carpentry: Introduction to Geospatial Concepts 2023-05 (2023.05). Zenodo. https://doi.org/10.5281/zenodo.7897047

To use this template to
start a new lesson repository,
make sure you're logged into Github.
Visit https://github.com/carpentries/workbench-template-rmd/generate
and follow the instructions.
Checking the 'Include all branches' option will save some time waiting for the first website build
when your new repository is initialised.
- Jemma Stachelek, Erin Alison Becker, Drake Asberry, Matt Strimas-Mackey, Annajiat Alim Rasel, Angela Li, Ryan Avery, kcarini, Kunal Marwaha, mneilson-usgs, Adam H. Sparks, bart1, Christian Boldsen Knudsen, Daniel Kerchner, Darya P Vanichkina, Pérez-Suárez, Jon Jablonski, Michael Liou, Natalia Morandeira, & Rob Williams. (2023). datacarpentry/r-raster-vector-geospatial: Data Carpentry: Introduction to Geospatial Raster and Vector Data with R, February 2023 (v2023.02.06). Zenodo. https://doi.org/10.5281/zenodo.7612769

If you have any questions, contact [@zkamvar](https://github.com/zkamvar)
## Citation

Please see the [CITATION page](https://github.com/carpentries-incubator/r-geospatial-urban/blob/main/CITATION.cff) for guidance on how to cite this lesson.

## License

The Geospatial Data Carpentry for Urbanism lesson, like most other software provided by The Carpentries, are made available under the OSI-approved MIT license. Please see the [LICENSE page](https://github.com/carpentries-incubator/r-geospatial-urban/blob/main/LICENSE.md) for further information.

## Rendered Version of This Lesson

Follow the steps below to
complete the initial configuration of a new lesson repository built from this template:

1. **Make sure GitHub Pages is activated:**
navigate to _Settings_,
select _Pages_ from the left sidebar,
and make sure that `gh-pages` is selected as the branch to build from.
If no `gh-pages` branch is available, check _Actions_ to see if the first
website build workflows are still running.
The branch should become available when those have completed.
1. **Adjust the `config.yaml` file:**
this file contains global parameters for your lesson site.
Individual fields within the file are documented with comments (beginning with `#`)
At minimum, you should adjust all the fields marked 'FIXME':
- `title`
- `created`
- `keywords`
- `life_cycle` (the default, _pre-alpha_, is the appropriate for brand new lessons)
- `contact`
1. **Annotate the repository** with site URL and topic tags:
navigate back to the repository landing page and
click on the gear wheel/cog icon (similar to ⚙️)
at the top-right of the _About_ box.
Check the "Use your GitHub Pages website" option,
and [add some keywords and other annotations to describe your lesson](https://cdh.carpentries.org/the-carpentries-incubator.html#topic-tags)
in the _Topics_ field.
At minimum, these should include:
- `lesson`
- the life cycle of the lesson (e.g. `pre-alpha`)
- the human language the lesson is written in (e.g. `deutsch`)
1. **Adjust the name of the `.Rproj` file.**
It is simplest to make this match the name of the repository.
1. **Adjust the
`CODE_OF_CONDUCT.md`, `CONTRIBUTING.md`, and `LICENSE.md` files**
as appropriate for your project.
- `CODE_OF_CONDUCT.md`:
if you are using this template for a project outside The Carpentries,
you should adjust this file to describe
who should be contacted with Code of Conduct reports,
and how those reports will be handled.
- `CONTRIBUTING.md`:
depending on the current state and maturity of your project,
the contents of the template Contributing Guide may not be appropriate.
You should adjust the file to help guide contributors on how best
to get involved and make an impact on your lesson.
- `LICENSE.md`:
in line with the terms of the CC-BY license,
you should ensure that the copyright information
provided in the license file is accurate for your project.
1. **Update this README with
[relevant information about your lesson](https://carpentries.github.io/lesson-development-training/collaborating-newcomers.html#readme)**
and delete this section.

[workbench]: https://carpentries.github.io/sandpaper-docs/
https://carpentries-incubator.github.io/r-geospatial-urban/

2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ carpentry: 'incubator'
title: 'Geospatial Data Carpentry for Urbanism'

# Date the lesson was created (YYYY-MM-DD, this is empty by default)
created:
created:

# Comma-separated list of keywords for the lesson
keywords: 'software, data, lesson, The Carpentries, geospatial'
Expand Down
34 changes: 18 additions & 16 deletions episodes/01-intro-to-r.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ invisible(lapply(packages, library, character.only = TRUE))

:::::::::::::::::::::::::::::::::::::: questions

- How to find your way around RStudio?
- How to manage projects in R?
- How to install packages?
- How to interact with R?
- How can I find my way around RStudio?
- How can I manage projects in R?
- How can I install packages?
- How can I interact with R?

::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down Expand Up @@ -105,11 +105,11 @@ An alternative solution is to create the folders using R command `dir.create()`.
In the console type:

```{r create-directories}
dir.create('data')
dir.create('data_output')
dir.create('documents')
dir.create('fig_output')
dir.create('scripts')
dir.create("data")
dir.create("data_output")
dir.create("documents")
dir.create("fig_output")
dir.create("scripts")
```

Expand Down Expand Up @@ -218,7 +218,7 @@ We will however need to install the `here` package. To do so, please go to your
script and type:

```{r install-here-package, eval=FALSE}
install.packages('here')
install.packages("here")
```

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: callout
Expand Down Expand Up @@ -311,8 +311,10 @@ In the script, we will write:

```{r download-files}
# Download the data
download.file('https://bit.ly/geospatial_data',
here('data','gapminder_data.csv'))
download.file(
"https://bit.ly/geospatial_data",
here("data", "gapminder_data.csv")
)
```

Expand All @@ -337,9 +339,9 @@ will not cover these in the workshop.
You can use R as calculator, you can for example write:

```{r calculator}
1+100
1*100
1/100
1 + 100
1 * 100
1 / 100
```

Expand All @@ -351,7 +353,7 @@ use them whenever we need to.
We using the assignment operator `<-`, like this:

```{r asignment-operator}
x <- 1/40
x <- 1 / 40
```

Notice that assignment does not print a value. Instead, we've stored it for later
Expand Down
Loading

0 comments on commit 59f5f68

Please sign in to comment.