diff --git a/.Rbuildignore b/.Rbuildignore new file mode 100644 index 0000000..d494c52 --- /dev/null +++ b/.Rbuildignore @@ -0,0 +1,4 @@ +^sigbm\.Rproj$ +^\.Rproj\.user$ +^\.github$ +^data-raw$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/download-sigbm.yaml b/.github/workflows/download-sigbm.yaml new file mode 100644 index 0000000..eb2981d --- /dev/null +++ b/.github/workflows/download-sigbm.yaml @@ -0,0 +1,37 @@ +on: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: "15 12 * * *" + workflow_dispatch: + branches: [main, master] + + +name: download-sigbm + +jobs: + download: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + with: + use-public-rspm: true + + - name: Install httr + run: install.packages("httr") + shell: Rscript {0} + + - name: download sigbm + run: httr::POST("https://app.anm.gov.br/SIGBM/Publico/ClassificacaoNacionalDaBarragem/ExportarExcel", httr::write_disk(paste0("data-raw/sigbm_download_", Sys.Date(),".xlsx"))) + shell: Rscript {0} + + - name: commit results + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add . + git commit -m 'Update data' || echo "Update data" + git push origin || echo "Update data" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..565f2b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.Rproj.user +.Rhistory +.Rdata +.httr-oauth +.DS_Store diff --git a/DESCRIPTION b/DESCRIPTION new file mode 100644 index 0000000..c65f3a0 --- /dev/null +++ b/DESCRIPTION @@ -0,0 +1,12 @@ +Package: sigbm +Title: What the Package Does (One Line, Title Case) +Version: 0.0.0.9000 +Authors@R: + person("First", "Last", , "first.last@example.com", role = c("aut", "cre"), + comment = c(ORCID = "YOUR-ORCID-ID")) +Description: What the package does (one paragraph). +License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a + license +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.1.2 diff --git a/NAMESPACE b/NAMESPACE new file mode 100644 index 0000000..6ae9268 --- /dev/null +++ b/NAMESPACE @@ -0,0 +1,2 @@ +# Generated by roxygen2: do not edit by hand + diff --git a/data-raw/DATASET.R b/data-raw/DATASET.R new file mode 100644 index 0000000..6514a94 --- /dev/null +++ b/data-raw/DATASET.R @@ -0,0 +1,3 @@ +## code to prepare `DATASET` dataset goes here + +usethis::use_data(DATASET, overwrite = TRUE) diff --git a/sigbm.Rproj b/sigbm.Rproj new file mode 100644 index 0000000..69fafd4 --- /dev/null +++ b/sigbm.Rproj @@ -0,0 +1,22 @@ +Version: 1.0 + +RestoreWorkspace: No +SaveWorkspace: No +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +AutoAppendNewline: Yes +StripTrailingWhitespace: Yes +LineEndingConversion: Posix + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace