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

New tests for extractfromLayer #22

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading