Skip to content

Commit f3d7822

Browse files
committed
test gh
1 parent 0345d8f commit f3d7822

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ License: MIT + file LICENSE
99
Encoding: UTF-8
1010
Roxygen: list(markdown = TRUE)
1111
RoxygenNote: 7.2.1
12-
URL: https://github.com/worldbank/blackmarbler
12+
URL: https://worldbank.github.io/blackmarbler/
1313
BugReports: https://github.com/worldbank/blackmarbler/issues
1414
biocViews:
1515
Imports:

readme_figures/build_package.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if(F){
77

88
usethis::use_pkgdown()
99
pkgdown::build_site()
10+
pkgdown::build_site_github_pages()
1011
usethis::use_pkgdown_github_pages()
1112

1213
usethis::use_pkgdown()

readme_figures/testing.R

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,51 @@ library(dplyr)
1919
library(httr)
2020

2121

22+
23+
library(blackmarbler)
24+
library(geodata)
25+
library(sf)
26+
library(ggplot2)
27+
28+
#bearer <- "BEARER-TOKEN"
29+
30+
roi <- gadm(country = "GHA",
31+
level=0,
32+
path = tempdir()) |>
33+
st_as_sf()
34+
35+
r <- bm_extract(roi_sf = roi,
36+
product_id = "VNP46A4",
37+
date = 2017,
38+
bearer = bearer)
39+
40+
r <- r |> mask(roi_sf)
41+
42+
r_df <- rasterToPoints(r, spatial = TRUE) |> as.data.frame()
43+
names(r_df) <- c("value", "x", "y")
44+
45+
## Transform NTL
46+
r_df$value[r_df$value <= 1] <- 0
47+
48+
r_df$value_adj <- log(r_df$value+1)
49+
50+
##### Map
51+
p <- ggplot() +
52+
geom_raster(data = r_df,
53+
aes(x = x, y = y,
54+
fill = value_adj)) +
55+
scale_fill_gradient2(low = "black",
56+
mid = "yellow",
57+
high = "red",
58+
midpoint = 4.5) +
59+
coord_quickmap() +
60+
theme_void() +
61+
theme(legend.position = "none")
62+
63+
64+
65+
66+
2267
bearer <- read.csv("~/Desktop/bearer_bm.csv") %>%
2368
pull(token)
2469

0 commit comments

Comments
 (0)