Skip to content

Commit

Permalink
Merge pull request #22 from EvolEcolGroup/extractFromLayer_test
Browse files Browse the repository at this point in the history
New tests for extractfromLayer
  • Loading branch information
eviecarter33 authored Mar 19, 2024
2 parents 9e8078e + f453792 commit b20a5e1
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 251 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: geoGraph
Type: Package
Title: Walking through the geographic space using graphs
Title: Walking Through the Geographic Space Using Graphs
Version: 1.1.1.9003
Authors@R: c(
person("Thibaut", "Jombart", role = "aut"),
Expand Down Expand Up @@ -34,7 +34,7 @@ Suggests:
rmarkdown,
rnaturalearthdata,
spelling
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
Collate:
'classes.R'
'accessors.R'
Expand All @@ -49,7 +49,7 @@ Collate:
'extractFromLayer.R'
'findLand.R'
'geo.segments.R'
'geograph.R'
'geograph-package.R'
'globals.R'
'hasCosts.R'
'interact.R'
Expand Down
15 changes: 14 additions & 1 deletion R/extractFromLayer.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,20 @@ setMethod("extractFromLayer", "data.frame", function(x, layer = "world", attr =




################
## for numeric vector (of long/lat)
################
#' @rdname extractFromLayer
#' @export
setMethod("extractFromLayer","numeric",function(x, layer = "world", attr = "all", ...) {
if(isTRUE(length(x) %% 2 == 0)){
x <- matrix(x, ncol = 2, byrow = TRUE)
return(extractFromLayer(x, layer = layer, attr = attr, ...))
} else {
stop ("Vector must have even number of longitude and latitude entries")
}

})


################
Expand Down
6 changes: 6 additions & 0 deletions R/geograph-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
## usethis namespace: end
NULL
131 changes: 0 additions & 131 deletions R/geograph.R

This file was deleted.

4 changes: 1 addition & 3 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Malaga
RBGL
RBGL's
Ringler
attr
antimeridian
closestNode
codecov
coords
Expand All @@ -23,7 +23,6 @@ gPath
geo
geoGraphEnv
georeferenced
goto
graphNEL
hgdp
img
Expand All @@ -35,7 +34,6 @@ nb
rawgraph
rawgraph's
rawgraphs
replot
replotting
rnaturalearth
roxygen
Expand Down
3 changes: 3 additions & 0 deletions man/extractFromLayer.Rd

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

117 changes: 5 additions & 112 deletions man/geoGraph-package.Rd

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

Loading

0 comments on commit b20a5e1

Please sign in to comment.