Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update text in c3 for v2 #658

Merged
merged 43 commits into from
Oct 28, 2021
Merged

Update text in c3 for v2 #658

merged 43 commits into from
Oct 28, 2021

Conversation

Robinlovelace
Copy link
Collaborator

No description provided.

@Robinlovelace
Copy link
Collaborator Author

Minor changes added in spare moment between family commitments : )

@Robinlovelace Robinlovelace changed the title Update package descriptions in c3 Update text in c3 for v2 Oct 24, 2021
@Robinlovelace Robinlovelace marked this pull request as ready for review October 24, 2021 10:09
@Robinlovelace
Copy link
Collaborator Author

Heads-up @Nowosad and @jannes-m I think this basically ready to go. Keen to merge soon to keep things moving (and I think I accidentally deployed it on the website) and get C3 ready for geocompr-es.

Copy link
Member

@Nowosad Nowosad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments:

  1. Robin, it seems that I do not fully understand how our book build works. Some of your changes are not merged yet, but I can already read them at https://geocompr.robinlovelace.net/attr.html. Why is that? Do we update the book based on PRs?
  2. Do we mention pivots (pivot_longer, pivot_wider) and binds (cbind and rbind) anywhere in the book? I think these are some basic operations very useful to get most data in shape.
  3. We should update exercises and solutions. I plan to do it for terra-related parts in the next few weeks.

03-attribute-operations.Rmd Outdated Show resolved Hide resolved
```

## Introduction

Attribute data is non-spatial information associated with geographic (geometry) data.
A bus stop provides a simple example: its position would typically be represented by latitude and longitude coordinates (geometry data), in addition to its name.
The name is an *attribute*\index{attribute} of the feature (to use Simple Features terminology) that bears no relation to its geometry.
The [Elephant & Castle / New Kent Road](https://www.openstreetmap.org/relation/6610626) stop in London, for example has coordinates of -0.098 degrees longitude and 51.495 degrees latitude which can be represented as `POINT (-0.098 51.495)` in the `sfc` representation described in Chapter \@ref(spatial-class).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @ref(spatial-class) reference seems broken.

03-attribute-operations.Rmd Outdated Show resolved Hide resolved
03-attribute-operations.Rmd Outdated Show resolved Hide resolved
03-attribute-operations.Rmd Outdated Show resolved Hide resolved
Key functions for subsetting data frames (including `sf` data frames) with **dplyr** functions are demonstrated below.
<!-- The sentence below seems to be untrue based on the benchmark below. -->
<!-- `dplyr` is also faster than base R for some operations, due to its C++\index{C++} backend. -->
<!-- Something on dbplyr? I've never seen anyone use it regularly for spatial data 'in the wild' so leaving out the bit on integration with dbs for now (RL 2021-10) -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would omit dbplyr for now. Maybe we could mention it in the bridges chapter (I never used it in the spatial context, though).

**dplyr** functions enable 'tidy' workflows which some people (the authors of this book included) find intuitive and productive for interactive data analysis, especially when combined with code editors such as RStudio that enable [auto-completion](https://support.rstudio.com/hc/en-us/articles/205273297-Code-Completion-in-the-RStudio-IDE) of column names.
Key functions for subsetting data frames (including `sf` data frames) with **dplyr** functions are demonstrated below.
<!-- The sentence below seems to be untrue based on the benchmark below. -->
<!-- `dplyr` is also faster than base R for some operations, due to its C++\index{C++} backend. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dataset is fairly small. Could you try it on larger datasets (with 1,000s or more of rows)?

03-attribute-operations.Rmd Outdated Show resolved Hide resolved
`slice()` is the row-equivalent of `select()`.
The following code chunk, for example, selects the 3^rd^ to 5^th^ rows:
The following code chunk, for example, selects rows 1 to 6:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 to 6?

03-attribute-operations.Rmd Outdated Show resolved Hide resolved
@Robinlovelace
Copy link
Collaborator Author

1. Robin, it seems that I do not fully understand how our book build works. Some of your changes are not merged yet, but I can already read them at https://geocompr.robinlovelace.net/attr.html. Why is that? Do we update the book based on PRs?

That was my fault, fixed (reverted) now: ad1f633

@Robinlovelace
Copy link
Collaborator Author

Robinlovelace commented Oct 28, 2021

Do we mention pivots (pivot_longer, pivot_wider) and binds (cbind and rbind) anywhere in the book? I think these are some basic operations very useful to get most data in shape.

Now mentioned pivot_longer().

rbind() is mentioned as follows:

rbind(), for example, is binds rows two data frames together, one 'on top' of the other.

I think that is fine, people can, and are encouraged to, read-up on data manipulation techniques elsewhere. I think it's fine not to mention cbind(). Too much time explaining these things is mission creep.

@Robinlovelace
Copy link
Collaborator Author

We should update exercises and solutions. I plan to do it for terra-related parts in the next few weeks.

Agreed, I didn't look at the exercises. I think we can do that after updating the content for each chapter, and I imagine they will get useful feedback during the review process.

@Robinlovelace
Copy link
Collaborator Author

Cool changes. I was just wondering - what do you think about "tidyverse package for reshaping data frames" for tidyr?

Yes but that comment was made on an outdated version of the content. The block is now shorter and simpler:

library(sf)      # vector data package introduced in Chapter 2
library(terra)   # raster data package introduced in Chapter 2
library(dplyr)   # tidyverse package for data frame manipulation

@Nowosad
Copy link
Member

Nowosad commented Oct 28, 2021

Cool changes. I was just wondering - what do you think about "tidyverse package for reshaping data frames" for tidyr?

Yes but that comment was made on an outdated version of the content. The block is now shorter and simpler:

library(sf)      # vector data package introduced in Chapter 2
library(terra)   # raster data package introduced in Chapter 2
library(dplyr)   # tidyverse package for data frame manipulation

Yes - this is the only comment in this PR that I made a few weeks ago (not today).

@Nowosad Nowosad merged commit 8d10d36 into main Oct 28, 2021
@Robinlovelace
Copy link
Collaborator Author

Yes - this is the only comment in this PR that I made a few weeks ago (not today).

Aha, apologies. Only saw (or re-saw?) that comment now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants