Skip to content

Commit

Permalink
Merge pull request #15 from rOpenGov/rogtemplate
Browse files Browse the repository at this point in the history
rogtemplate project
  • Loading branch information
dieghernan authored Oct 25, 2021
2 parents 89fdfbc + c7f073d commit eded652
Show file tree
Hide file tree
Showing 93 changed files with 184 additions and 19,211 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
^pkgdown$
^README\.Rmd$
^\.github$
^\._pkgdown\.yml$
2 changes: 2 additions & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.html
R-version
*.Rds
68 changes: 21 additions & 47 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- main
- master
branches: [main, master]
pull_request:
branches:
- main
- master
branches: [main, master]

name: R-CMD-check

Expand All @@ -22,59 +18,37 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@master

- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@master
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
extra-packages: rcmdcheck

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@master

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/rogtemplate-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
tags: ['*']
workflow_dispatch:

name: rogtemplate-gh-pages

jobs:
rogtemplate-gh-pages:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v1

- uses: r-lib/actions/setup-r@v1
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: |
magick
ropengov/rogtemplate
needs: website

- name: Build logo if not present and prepare template
run: |
# Check that logo is not present
if (isFALSE(file.exists(file.path("man", "figures", "logo.png")) ||
file.exists(file.path("man", "figures", "logo.png")))) {
rogtemplate::rog_logo()
} else {
message("The package already has a logo")
}
rogtemplate::rog_add_template_pkgdown()
shell: Rscript {0}

- name: Deploy package
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
32 changes: 32 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
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
install-r: false

- uses: r-lib/actions/setup-r-dependencies@v1
with:
cache-version: 30
extra-packages: covr

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ vignettes/*.pdf
rsconnect/
.Rproj.user
inst/doc
docs
32 changes: 19 additions & 13 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@ Title: Finnish Meteorological Institute open data API R client
Version: 0.2.0
Date: 2020-11-29
Authors@R: c(
person("Joona", "Lehtomaki", email = "[email protected]", role = c("aut", "cre")),
person("Leo", "Lahti", role = c("aut"), comment = c(ORCID = "0000-0001-5537-637X")),
person("Ilari", "Scheinin", role = "ctb")
person("Joona", "Lehtomaki", , "[email protected]", role = c("aut", "cre")),
person("Leo", "Lahti", role = "aut",
comment = c(ORCID = "0000-0001-5537-637X")),
person("Ilari", "Scheinin", role = "ctb")
)
Description: R client for the Finnish Meteorological Institute (FMI) open data
API. This package supersedes the obsolete fmi package. Client can be used to
fetch geospatial over FMI's WFS <http://en.ilmatieteenlaitos.fi/open-data-manual-accessing-data>
and converted into geospatial objects in R.
Description: R client for the Finnish Meteorological Institute (FMI) open
data API. This package supersedes the obsolete fmi package. Client can
be used to fetch geospatial over FMI's WFS
<https://en.ilmatieteenlaitos.fi/open-data-manual-accessing-data> and
converted into geospatial objects in R.
License: MIT + file LICENSE
URL: https://ropengov.github.io/fmi2/, https://github.com/rOpenGov/fmi2
BugReports: https://github.com/rOpenGov/fmi2/issues
Depends:
R (>= 3.3)
Imports:
checkmate (>= 1.9.4),
dplyr (>= 0.7.6),
glue (>= 1.3.1),
httr (>= 1.4.1),
httpcache (>= 1.1.0),
httr (>= 1.4.1),
lubridate (>= 1.7.4),
magrittr (>= 1.5),
methods,
Expand All @@ -38,16 +42,18 @@ Suggests:
leaflet (>= 2.0.2),
prettydoc (>= 0.3.0),
rmarkdown (>= 1.10),
roxygen2 (>= 6.1.1),
skimr (>= 1.0.7),
testthat (>= 2.0.0),
tidyr (>= 0.8.3),
roxygen2 (>= 6.1.1)
VignetteBuilder: knitr
tidyr (>= 0.8.3)
VignetteBuilder:
knitr
ByteCompile: true
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
X-schema.org-isPartOf: http://ropengov.org/
X-schema.org-keywords: ropengov
Collate:
'fmi2-global.R'
'aaa.R'
Expand Down
2 changes: 1 addition & 1 deletion R/fmi_stations.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#'
#' @return a \code{tibble} of active observation stations
#'
#' @seealso \url{http://en.ilmatieteenlaitos.fi/observation-stations}
#' @seealso \url{https://en.ilmatieteenlaitos.fi/observation-stations}
#'
#' @author Joona Lehtomaki \email{joona.lehtomaki@@gmail.com}
#'
Expand Down
17 changes: 9 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
output: md_document
output: github_document
---

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, include = FALSE}
Expand All @@ -13,17 +12,19 @@ knitr::opts_chunk$set(
)
```

# fmi2 - R client for the Finnish Meteorological Institute's (FMI) API
# fmi2 - R client for the Finnish Meteorological Institute's (FMI) API <a href='https://ropengov.github.io/fmi2/'><img src='man/figures/logo.png' align="right" height="139" /></a>

<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![codecov](https://codecov.io/gh/rOpenGov/fmi2/branch/master/graph/badge.svg)](https://codecov.io/gh/rOpenGov/fmi2)
[![rOG-badge](https://ropengov.github.io/rogtemplate/reference/figures/ropengov-badge.svg)](http://ropengov.org/)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![codecov](https://codecov.io/gh/rOpenGov/fmi2/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rOpenGov/fmi2)
[![CRAN status](https://www.r-pkg.org/badges/version/fmi2)](https://CRAN.R-project.org/package=fmi2)
[![R build status](https://github.com/rOpenGov/fmi2/workflows/R-CMD-check/badge.svg)](https://github.com/rOpenGov/fmi2/actions)

<!-- badges: end -->

R client package for [the Finnish Meteorological Institute (FMI) open data API](https://en.ilmatieteenlaitos.fi/open-data-manual). `fmi2` provides access
to a subset of the FMI [download](http://en.ilmatieteenlaitos.fi/open-data-manual-accessing-data)
to a subset of the FMI [download](https://en.ilmatieteenlaitos.fi/open-data-manual-accessing-data)
service. FMI maintains and is reponsible for the data available through their
API, but has no official connections to `fmi2`.

Expand Down Expand Up @@ -57,9 +58,9 @@ More data sets and queries may be wrapped in the future.

## Example

For usage examples, see the package [function reference](https://ropengov.github.io/fmi2/reference/index.html) and the following vignettes:
For usage examples, see the package [function reference](https://ropengov.github.io/fmi2//reference/index.html) and the following vignettes:

- [Getting weather observation data](https://ropengov.github.io/fmi2/articles/weather_observation_data.html)
- [Getting weather observation data](https://ropengov.github.io/fmi2//articles/weather_observation_data.html)

## Contributing

Expand Down
Loading

0 comments on commit eded652

Please sign in to comment.