Skip to content

Commit

Permalink
Added fmesher test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewzm committed Jun 17, 2024
1 parent e8694a2 commit 565ab89
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion R/plottingfns.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ draw_world <- function(g = ggplot() + theme_bw() + xlab("") + ylab(""),inc_borde
}

## Now return a gg object with the map overlayed
g + geom_path(data = worldmap, aes(x=long, y=lat, group=group), colour="black",size=0.1)
g + geom_path(data = worldmap, aes(x=long, y=lat, group=group), colour="black",linewidth=0.1)
}

#' @rdname show_basis
Expand Down
19 changes: 12 additions & 7 deletions tests/testthat/test_basis.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,18 @@ test_that("can average basis over polygons in plane", {
HexPols_df <- SpatialPolygonsDataFrame(HexPols,
cbind(over(HexPols,meuse.grid),
coordinates(HexPts)))
## Generate basis functions
G <- auto_basis(manifold = plane(),data=meuse,nres = 2,prune=10,type = "Gaussian")

expect_true({eval_basis(G,coordinates(HexPts)); TRUE})
expect_true({eval_basis(G,HexPols_df); TRUE})
#plot(as.numeric(S1))
#lines(as.numeric(S2),col='red')
## Generate regular basis functions with prune
G1 <- auto_basis(manifold = plane(),data=meuse,nres = 2,prune=10,type = "Gaussian")
expect_true({eval_basis(G1,coordinates(HexPts)); TRUE})
expect_true({eval_basis(G1,HexPols_df); TRUE})
#plot(as.numeric(S1))
#lines(as.numeric(S2),col='red')

## Generate irregular basis functions, no prune, with fmesher
G2 <- auto_basis(manifold = plane(), data=meuse, nres = 2, type = "bisquare", regular = 0)
expect_true({eval_basis(G2,coordinates(HexPts)); TRUE})
expect_true({eval_basis(G2,HexPols_df); TRUE})

})

## Deprecated:
Expand Down

0 comments on commit 565ab89

Please sign in to comment.