Skip to content

Commit 8101ffa

Browse files
committed
Readme
1 parent 0f69036 commit 8101ffa

File tree

6 files changed

+128
-4
lines changed

6 files changed

+128
-4
lines changed

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
name: R-CMD-check
10+
11+
jobs:
12+
R-CMD-check:
13+
runs-on: ${{ matrix.config.os }}
14+
15+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
config:
21+
- {os: macos-latest, r: 'release'}
22+
- {os: windows-latest, r: 'release'}
23+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24+
- {os: ubuntu-latest, r: 'release'}
25+
- {os: ubuntu-latest, r: 'oldrel-1'}
26+
27+
env:
28+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
29+
R_KEEP_PKG_SOURCE: yes
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- uses: r-lib/actions/setup-pandoc@v2
35+
36+
- uses: r-lib/actions/setup-r@v2
37+
with:
38+
r-version: ${{ matrix.config.r }}
39+
http-user-agent: ${{ matrix.config.http-user-agent }}
40+
use-public-rspm: true
41+
42+
- uses: r-lib/actions/setup-r-dependencies@v2
43+
with:
44+
extra-packages: any::rcmdcheck
45+
needs: check
46+
47+
- uses: r-lib/actions/check-r-package@v2
48+
with:
49+
upload-snapshots: true

.github/workflows/pkgdown.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
11+
12+
name: pkgdown
13+
14+
jobs:
15+
pkgdown:
16+
runs-on: ubuntu-latest
17+
# Only restrict concurrency for non-PR jobs
18+
concurrency:
19+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
20+
env:
21+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
permissions:
23+
contents: write
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- uses: r-lib/actions/setup-pandoc@v2
28+
29+
- uses: r-lib/actions/setup-r@v2
30+
with:
31+
use-public-rspm: true
32+
33+
- uses: r-lib/actions/setup-r-dependencies@v2
34+
with:
35+
extra-packages: any::pkgdown, local::.
36+
needs: website
37+
38+
- name: Build site
39+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
40+
shell: Rscript {0}
41+
42+
- name: Deploy to GitHub pages 🚀
43+
if: github.event_name != 'pull_request'
44+
uses: JamesIves/[email protected]
45+
with:
46+
clean: false
47+
branch: gh-pages
48+
folder: docs

DESCRIPTION

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ License: MIT + file LICENSE
99
Encoding: UTF-8
1010
Roxygen: list(markdown = TRUE)
1111
RoxygenNote: 7.2.1
12-
URL: https://ramarty.github.io/blackmarbler/
13-
BugReports: https://github.com/ramarty/blackmarbler/issues
12+
URL: https://worldbank.github.io/blackmarbler/
13+
BugReports: https://github.com/worldbank/blackmarbler/issues
1414
biocViews:
1515
Imports:
1616
readr,
@@ -22,4 +22,5 @@ Imports:
2222
sf,
2323
exactextractr,
2424
stringr,
25-
rhdf5
25+
rhdf5,
26+
httr

readme_figures/build_package.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ if(F){
44
roxygen2::roxygenise("~/Documents/Github/blackmarbler")
55

66
pkgdown::clean_site()
7+
8+
usethis::use_pkgdown()
9+
pkgdown::build_site()
710
pkgdown::deploy_to_branch()
11+
12+
usethis::use_pkgdown()
13+
usethis::use_github_pages()
814
usethis::use_pkgdown_github_pages() #####
915
usethis::use_github_action_check_standard()
1016

readme_figures/testing.R

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,28 @@ gha_0_sf <- gadm(country = "GHA", level=0, path = tempdir()) %>% st_as_sf()
2626

2727
r_2021 <- bm_raster(roi_sf = gha_0_sf,
2828
product_id = "VNP46A4",
29-
date = 2019,
29+
date = 2018,
3030
bearer = bearer)
3131

32+
r_2021_c <- bm_raster(roi_sf = gha_0_sf,
33+
product_id = "VNP46A4",
34+
date = 2020,
35+
variable = "NearNadir_Composite_Snow_Free",
36+
bearer = bearer)
37+
38+
r_2021_c_n <- bm_raster(roi_sf = gha_0_sf,
39+
product_id = "VNP46A3",
40+
date = "2021-10",
41+
variable = "NearNadir_Coamposite_Snow_Free_Num",
42+
bearer = bearer)
43+
44+
h5_data <- H5Fopen("~/Desktop/testaa.h5")
45+
46+
variable <- "NearNadir_Composite_Snow_Free_Num"
47+
out <- h5_data$HDFEOS$GRIDS$VIIRS_Grid_DNB_2d$`Data Fields`[[variable]]
48+
49+
summary(as.vector(out))
50+
3251
headers <- c('Authorization' = paste('Bearer', bearer))
3352
response <- GET(urla, add_headers(headers), write_disk("~/Desktop/aaaa.h5", overwrite = TRUE))
3453
response

0 commit comments

Comments
 (0)