Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/jhollist/quickmapr Conflicts: .Rbuildignore
- Loading branch information
Showing
34 changed files
with
870 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ | |
^README\.pdf$ | ||
^figure$ | ||
^NEWS\.md$ | ||
^log_check\.R$ | ||
^log_check\.R$ | ||
^manuscript$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
language: r | ||
warnings_are_errors: true | ||
dist: trusty | ||
cache: packages | ||
sudo: true | ||
|
||
r: | ||
- oldrel | ||
- release | ||
- devel | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- libgdal-dev | ||
- libproj-dev | ||
r_binary_packages: | ||
- rgdal | ||
- sp | ||
|
||
notifications: | ||
email: | ||
on_success: change | ||
on_failure: change | ||
|
||
r_github_packages: | ||
- jimhester/covr | ||
|
||
after_success: | ||
- Rscript -e 'library(covr); coveralls()' | ||
|
||
notifications: | ||
email: | ||
on_success: change | ||
on_failure: change |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#' Measure | ||
#' | ||
#' Allows interactive selection of points and returns length of selecte line in | ||
#' units of the current \code{qmap} object. | ||
#' @param qmap_obj a \code{qmap} object from which to measure features. | ||
#' | ||
#' @import sp | ||
#' @export | ||
m <- function(qmap_obj = NULL){ | ||
if (class(qmap_obj) != "qmap") { | ||
stop("Requires a valid qmap_obj.") | ||
} | ||
plot(qmap_obj) | ||
message("Click on plot to draw line to measure. Press 'Esc' to exit.") | ||
loc <- locator(1) | ||
locs <- coordinates(loc) | ||
while (!is.null(loc)) { | ||
sl <- SpatialLines(list(Lines(list(Line(locs)), "id"))) | ||
plot(sl,add=T) | ||
loc <- locator(1) | ||
if(!is.null(loc)){ | ||
locs<-rbind(locs,coordinates(loc)) | ||
} | ||
} | ||
rgeos::gLength(sl) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.