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

Add ability for overline to use grouping variables. #92

Merged
merged 6 commits into from
Aug 23, 2016

Conversation

richardellison
Copy link
Collaborator

No description provided.

@richardellison richardellison changed the title Add ability for overline to using grouping variables. Add ability for overline to use grouping variables. Aug 21, 2016
@Robinlovelace
Copy link
Member

Robinlovelace commented Aug 22, 2016

This looks good, but can you provide an example in @examples to show what it does.

Imagine when you have different routes it will be useful to return results for each segment for each route type, right? Interested in your use case.

@richardellison
Copy link
Collaborator Author

I will try to come up with a simple example.

What I am doing is overlaying trips between bus stops with the number of passengers travelling between each pair of bus stops so I get how many people are travelling on a specific section of a bus route. In my case I am doing this for passengers who take a specific bus route (to see which services they are connecting to/from) and for that reason I want to keep the different bus routes separate even when they travel along the same road (the white line is the "reference" route):

busroutesmap

@Robinlovelace
Copy link
Member

Very cool - so glad it's useful beyond the specific use case for which it was developed: that map looks great. Maybe the following code could form the basis of a simple example that uses this new functionality:

library(stplanr)
routes_fast$group = rep(1:3, length.out = nrow(routes_fast))
rnet_grouped = overline(routes_fast, attrib = "length", byvars = "group")

(For some reason that code breaks using your update of the function - any ideas?)

@richardellison
Copy link
Collaborator Author

It seems I forgot to replace the column names I was using to test the function with the variable that was being passed to the function. I've fixed that now and added your example to the documentation.

@Robinlovelace Robinlovelace merged commit db2a09c into ropensci:master Aug 23, 2016
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