Skip to content

Commit

Permalink
Merge pull request #232 from Robinlovelace/master
Browse files Browse the repository at this point in the history
Make updates ready for release
  • Loading branch information
Robinlovelace authored Nov 23, 2017
2 parents 76bda2a + 95b6ed0 commit fd2da31
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
5 changes: 1 addition & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: stplanr
Type: Package
Title: Sustainable Transport Planning
Version: 0.1.9
Version: 0.2.1
Authors@R: c(
person("Robin", "Lovelace", email = "rob00x@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-5679-6536")),
Expand Down Expand Up @@ -53,9 +53,6 @@ Suggests:
dodgr
Enhances:
tmap
Remotes:
r-spatial/sf,
ATFutures/dodgr
VignetteBuilder: knitr
URL: https://github.com/ropensci/stplanr
SystemRequirements: GNU make
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@

## NEW FEATURES

* This is the largest release since the package was created, with dozens of changes to support simple features - see https://github.com/ropensci/stplanr/pull/198 for details.
* Support for **sf**. The package now support the new spatial class system for most functions.
* New function `geo_bb()` supercedes `bb2poly()`. The new function can return polygons, points and matrix objects determined by the `output` argument. It also allows bounding boxes to be extended in metres, and scaled in x and y dimensions.
* `geo_code()` now uses nominatim by default to find locations on the maps.
* New function `od_coords()` takes a wide range of input data types to return a consistent output representing OD data as a data frame of origin and destination coordinates. This is used behind the scenes to make other functions more modular.

## WORK IN PROGRESS

Plans for the next release

* New generic `route()` function for routing. This is more flexible and user-friendly than the existing `line2route()` and `route_*()` functions it enhances.
* Updated function names to make using **stplanr** easier and more intuitive.


# stplanr 0.1.9
Expand Down
6 changes: 4 additions & 2 deletions R/overline.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ lineLabels <- function(sl, attrib){
#' rnet2 <- overline(sl = sl, attrib = "length", buff_dist = 1)
#' plot(rnet1, lwd = rnet1$length / mean(rnet1$length))
#' plot(rnet2, lwd = rnet2$length / mean(rnet2$length))
#' \dontrun{
#' routes_fast$group = rep(1:3, length.out = nrow(routes_fast))
#' rnet_grouped = overline(routes_fast, attrib = "length", byvars = "group", buff_dist = 1)
#' plot(rnet_grouped, col = rnet_grouped$group, lwd =
Expand All @@ -151,6 +152,7 @@ lineLabels <- function(sl, attrib){
#' overline(sl = sl, attrib = "length", buff_dist = 10)
#' rnet_sf = overline(routes_fast_sf, attrib = "length", buff_dist = 10)
#' plot(rnet_sf$geometry, lwd = rnet_sf$length / mean(rnet_sf$length))
#' }
overline <- function(sl, attrib, fun = sum, na.zero = FALSE, byvars = NA, buff_dist = 0) {
UseMethod("overline")
}
Expand Down Expand Up @@ -306,9 +308,9 @@ onewaygeo <- function(x, attrib) {
onewaygeo.sf <- function(x, attrib) {
geq <- sf::st_equals(x, x, sparse = FALSE) | sf::st_equals_exact(x, x, sparse = FALSE, par = 0.0)
sel1 <- !duplicated(geq) # repeated rows
x$matching_rows = apply(geq, 1, function(x) paste0(formatC(which(x), width = 2, format = "d", flag = 0), collapse = "-"))
x$matching_rows = apply(geq, 1, function(x) paste0(formatC(which(x), width = 4, format = "d", flag = 0), collapse = "-"))

singlelines <- aggregate(x[attrib], list(x$matching_rows), FUN = sum)
singlelines <- stats::aggregate(x[attrib], list(x$matching_rows), FUN = sum)

return(singlelines)
}
Expand Down
14 changes: 10 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
* Linux
- Local
- Travis: https://travis-ci.org/ropensci/stplanr/builds/252840164?utm_source=github_status&utm_medium=notification
- r-devel-ubuntu:

* MacOS
- elcapitan on rhub: https://builder.r-hub.io/status/stplanr_0.1.9.tar.gz-a163aa51c4d243269fedcdba637339fb
- elcapitan on rhub: https://builder.r-hub.io/status/stplanr_0.2.1.tar.gz-bc643a88aeeb4be18dc13a1097a1ef38

* Windows
- rhub (warning due to pandoc-citeproc): https://builder.r-hub.io/status/stplanr_0.1.9.tar.gz-e8f3870507504f3c8642d597d529f3f1
- rhub release (warning due to pandoc): https://builder.r-hub.io/status/stplanr_0.2.1.tar.gz-9a4bc29713d44514b6589b043ff5b15d
- rhub devel (fail due to dependency issues): https://builder.r-hub.io/status/stplanr_0.2.1.tar.gz-3655ad52ae97420bba8ad925eff71778


## R CMD check:

OK
OK - but a note about package reviewer:

```
Authors@R field gives persons with non-standard roles:
Scott Chamberlin [rev] (Scott reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/10): rev
```
2 changes: 2 additions & 0 deletions man/overline.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fd2da31

Please # to comment.