Skip to content

Commit 6e36fce

Browse files
committed
rhub check
1 parent 02c2a6a commit 6e36fce

17 files changed

+162
-72
lines changed

.Rbuildignore

+4
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
^docs$
1515
^pkgdown$
1616
^revdep$
17+
^Dockerfile$
18+
^Main\.R
19+
^docker-compose\.yaml
20+
^UnnamedFileRapi\.xlsx$

.github/workflows/rhub.yaml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
2+
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
3+
# You can update this file to a newer version using the rhub2 package:
4+
#
5+
# rhub::rhub_setup()
6+
#
7+
# It is unlikely that you need to modify this file manually.
8+
9+
name: R-hub
10+
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
config:
16+
description: 'A comma separated list of R-hub platforms to use.'
17+
type: string
18+
default: 'linux,windows,macos'
19+
name:
20+
description: 'Run name. You can leave this empty now.'
21+
type: string
22+
id:
23+
description: 'Unique ID. You can leave this empty now.'
24+
type: string
25+
26+
jobs:
27+
28+
setup:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
containers: ${{ steps.rhub-setup.outputs.containers }}
32+
platforms: ${{ steps.rhub-setup.outputs.platforms }}
33+
34+
steps:
35+
# NO NEED TO CHECKOUT HERE
36+
- uses: r-hub/actions/setup@v1
37+
with:
38+
config: ${{ github.event.inputs.config }}
39+
id: rhub-setup
40+
41+
linux-containers:
42+
needs: setup
43+
if: ${{ needs.setup.outputs.containers != '[]' }}
44+
runs-on: ubuntu-latest
45+
name: ${{ matrix.config.label }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
config: ${{ fromJson(needs.setup.outputs.containers) }}
50+
container:
51+
image: ${{ matrix.config.container }}
52+
53+
steps:
54+
- uses: r-hub/actions/checkout@v1
55+
- uses: r-hub/actions/platform-info@v1
56+
with:
57+
token: ${{ secrets.RHUB_TOKEN }}
58+
job-config: ${{ matrix.config.job-config }}
59+
- uses: r-hub/actions/setup-deps@v1
60+
with:
61+
token: ${{ secrets.RHUB_TOKEN }}
62+
job-config: ${{ matrix.config.job-config }}
63+
- uses: r-hub/actions/run-check@v1
64+
with:
65+
token: ${{ secrets.RHUB_TOKEN }}
66+
job-config: ${{ matrix.config.job-config }}
67+
68+
other-platforms:
69+
needs: setup
70+
if: ${{ needs.setup.outputs.platforms != '[]' }}
71+
runs-on: ${{ matrix.config.os }}
72+
name: ${{ matrix.config.label }}
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
config: ${{ fromJson(needs.setup.outputs.platforms) }}
77+
78+
steps:
79+
- uses: r-hub/actions/checkout@v1
80+
- uses: r-hub/actions/setup-r@v1
81+
with:
82+
job-config: ${{ matrix.config.job-config }}
83+
token: ${{ secrets.RHUB_TOKEN }}
84+
- uses: r-hub/actions/platform-info@v1
85+
with:
86+
token: ${{ secrets.RHUB_TOKEN }}
87+
job-config: ${{ matrix.config.job-config }}
88+
- uses: r-hub/actions/setup-deps@v1
89+
with:
90+
job-config: ${{ matrix.config.job-config }}
91+
token: ${{ secrets.RHUB_TOKEN }}
92+
- uses: r-hub/actions/run-check@v1
93+
with:
94+
job-config: ${{ matrix.config.job-config }}
95+
token: ${{ secrets.RHUB_TOKEN }}

DESCRIPTION

+11-25
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
Package: Rapi
22
Type: Package
3-
Title: Interface for Multiple Data Providers 'EDDS' and 'FRED'
4-
Version: 1.0.5
5-
Date: 2024-04-06
3+
Title: Interface for Multiple Data Providers `EDDS` and `FRED`
4+
Version: 1.0.6
5+
Date: 2025-01-13
66
Authors@R: c(
77
person("Sermet", "Pekin", , "sermet.pekin@gmail.com", role = c("aut", "cre" , "cph"))
88
)
99
Maintainer: Sermet Pekin <sermet.pekin@gmail.com>
1010
URL: https://github.com/DataRapi/Rapi, https://DataRapi.github.io/Rapi/
1111
BugReports: https://github.com/DataRapi/Rapi/issues
1212
Description: Interface for multiple data sources, such as the
13-
'EDDS' API <https://evds2.tcmb.gov.tr/index.php?/evds/userDocs> of the
13+
`EDDS` API <https://evds2.tcmb.gov.tr/index.php?/evds/userDocs> of the
1414
Central Bank of the Republic of Türkiye and the
15-
'FRED' API <https://fred.stlouisfed.org/docs/api/fred/> of the Federal Reserve Bank.
15+
`FRED` API <https://fred.stlouisfed.org/docs/api/fred/> of the Federal Reserve Bank.
1616
Both data providers require API keys for access, which users can easily obtain
1717
by creating accounts on their respective websites.
1818
The package provides caching ability with the selection of periods to increase the
@@ -26,26 +26,12 @@ LinkingTo: Rcpp
2626
Depends:
2727
R (>= 3.4.3),
2828
Rcpp
29-
Imports:
30-
crayon,
31-
digest,
32-
dplyr,
33-
httr,
34-
httr2,
35-
glue,
36-
jsonlite,
37-
lubridate,
38-
magrittr,
39-
purrr,
40-
rlang,
41-
rlist,
42-
stringr,
43-
tibble
44-
Suggests:
45-
writexl ,
46-
devtools,
47-
testthat
29+
Imports: crayon, digest, dplyr,
30+
httr, httr2, glue, jsonlite,
31+
lubridate, magrittr, purrr, rlang,
32+
rlist, stringr, tibble, writexl
33+
Suggests: devtools, testthat
4834
Roxygen: list(markdown = TRUE)
49-
RoxygenNote: 7.3.1
35+
RoxygenNote: 7.3.2
5036
Encoding: UTF-8
5137
Config/testthat/edition: 3

NEWS.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Rapi (development version)
22

3+
# Rapi 1.0.6
4+
* Better `set_api_key` function was implemented.
5+
* moved `writexl` package from suggested to required.
6+
37
# Rapi 1.0.5
48
* Moved key parameter to the header for the source `EVDS`.
59

@@ -8,4 +12,4 @@
812

913
# Rapi 1.0.3
1014

11-
* Initial CRAN submission. (previously named vyos)
15+
* Initial CRAN submission. (previously named `vyos`)

R/api_keys.R

+7-7
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ show_usage <- function(func_name = "set_api_key",
142142

143143
#' set_api_key
144144
#'
145-
#' @param key api key of the source
146-
#' @param source_name evds or fred
147-
#' @param option choice of later usage. env or file should be given to
148-
#' save api key for later use. Default is env which
149-
#' saves api key as environment variable.
150-
#' if `env` default value is selected it will save api key
145+
#' @param key API key of the source
146+
#' @param source_name `evds` or `fred`
147+
#' @param option choice of later usage. `env` or file should be given to
148+
#' save API key for later use. Default is env which
149+
#' saves API key as environment variable.
150+
#' if `env` default value is selected it will save API key
151151
#' as an environment variable
152-
#' if `file` was selected it will save api key to current folder.
152+
#' if `file` was selected it will save API key to current folder.
153153
#' @param ... for future versions
154154
#' @return
155155
#' The function has no return value.

R/excel.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
#' Rapi_GETPREP object.
33
#' @description
44
#' The excel() function creates an excel file according to the object given.
5-
#' data.frame or List of data frame or Rapi_GETPREP object can be passed..
5+
#' `data.frame` or List of data frame or `Rapi_GETPREP` object can be passed..
66
#' @param dfs object or list of data frame to write
77
#' @param file_name file name to save
88
#' @param folder folder to save file
99
#' @param .debug for internal use
1010
#' @param env environment
1111
#' @param ... for future versions
12-
#' @return it returns object or list of data frame back
12+
#' @return it returns object or list of `dataframe` back
1313
#' @export
1414
#' @examples
1515
#' \dontrun{

R/get_series_export.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' Requests data from multiple data sources.
22
#'
3-
#' The `get_series()` function retrieves data from various sources, including the EDDS API and FRED API at this version.
3+
#' The `get_series()` function retrieves data from various sources, including the `EDDS` API and `FRED` API at this version.
44
#' When multiple indexes are provided as a character vector or string template, the function individually
55
#' requests each item from the corresponding sources, discerning the source from the item's format.
66
#' The function combines data frames when there are common frequencies and returns both a combined data frame and
@@ -18,7 +18,7 @@
1818
#' If verbose option is FALSE it gives a warning only if something goes wrong.
1919
#' @param ... Additional parameters for future versions.
2020
#' @param debug Debug option for development.
21-
#' @param source Source such as "evds" or "fred" for internal use at this version.
21+
#' @param source Source such as `evds` or `fred` for internal use at this version.
2222
#' @param base Table or series on the source for internal use at this version.
2323
#' @return An S3 object, Rapi_GETPREP, which has generic functions such as print and excel.
2424
#' The `print` generic provides hints to the user on how to use requested data,

R/lag_df.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#' and lag sequences. This feature is beneficial for scenarios where you need
55
#' varying lag selections for certain columns, allowing flexibility in specifying
66
#' different lags for different columns or opting for no lag at all.
7-
#' @param df A data.frame or tibble.
7+
#' @param df A data.frame or `tibble`.
88
#' @param laglist A list of column names where each index corresponds to a column
99
#' name and the associated value is the lag sequence.
10-
#' @return tibble
10+
#' @return `tibble`
1111
#' @export
1212
#'
1313
#' @examples
@@ -26,7 +26,7 @@ as_tibblex <- function(df) {
2626
#' and lag sequences. This feature is beneficial for scenarios where you need
2727
#' varying lag selections for certain columns, allowing flexibility in specifying
2828
#' different lags for different columns or opting for no lag at all.
29-
#' @param df A data.frame or tibble.
29+
#' @param df A data.frame or `tibble`.
3030
#' @param laglist A list of column names where each index corresponds to a column
3131
#' name and the associated value is the lag sequence.
3232
#' @return data.frame

R/sp_df_utils.R

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ remove_column <- function(df, column_name) {
4848
#' remove_na_safe
4949
#' @description
5050
#' This function removes rows from both ends of a data frame until it identifies
51-
#' a row where all columns have non-NA values. Starting from the beginning, it
51+
#' a row where all columns have `non-NA` values. Starting from the beginning, it
5252
#' removes rows until it encounters a row with complete data at a specific row
5353
#' index (e.g., row 5).
5454
#' It then proceeds to remove rows from the end of the data frame, eliminating
55-
#' any rows with at least one NA value in any column.
56-
#' The process stops when it finds a row where all columns contain non-NA values,
55+
#' any rows with at least one `NA` value in any column.
56+
#' The process stops when it finds a row where all columns contain `non-NA` values,
5757
#' and the resulting data frame is returned.
5858
#'
59-
#' @param df data.frame to remove na rows from the beginning and from the end
60-
#' @param verbose give detailed info while removing NA values
59+
#' @param df data.frame to remove `NA` rows from the beginning and from the end
60+
#' @param verbose give detailed info while removing `NA` values
6161
#'
6262
#' @usage remove_na_safe(df , verbose = FALSE )
63-
#' @return data.frame returns data.frame after removing rows if all columns are NA
63+
#' @return data.frame returns data.frame after removing rows if all columns are `NA`
6464
#' from the beginning and after
6565
#' @export
6666
#' @examples

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
## Overview
1313

1414
Rapi package is an interface to make requests from data providers.
15-
Current version is able to connect to APIs of [EDDS](https://evds2.tcmb.gov.tr/index.php?/evds/userDocs/) of CBRT (Central Bank of the Republic of Türkiye)
15+
Current version is able to connect to APIs of [`EDDS`](https://evds2.tcmb.gov.tr/index.php?/evds/userDocs/) of CBRT (Central Bank of the Republic of Türkiye)
1616
and [FRED API](https://fred.stlouisfed.org/docs/api/fred/) of FED (Federal Reserve Bank).
1717

1818
## Installation
@@ -41,7 +41,7 @@ install_github("DataRapi/Rapi")
4141

4242

4343
``` r
44-
# Set API keys for EDDS
44+
# Set API keys for `EDDS`
4545
set_api_key("YOUR_EDDS_API_KEY", "evds", "env")
4646
# Set API keys for FRED
4747
set_api_key("YOUR_FRED_API_KEY", "fred", "env")
@@ -465,12 +465,12 @@ excel(obj, "file_name.xlsx", "somefolder")
465465
```
466466
## Getting API Keys
467467

468-
To access data from EDDS (CBRT) and FRED (FED), users need to obtain API keys by creating accounts on their respective websites.
468+
To access data from `EDDS` (CBRT) and FRED (FED), users need to obtain API keys by creating accounts on their respective websites.
469469

470-
### EDDS (CBRT) API Key
470+
### `EDDS` (CBRT) API Key
471471

472-
1. Visit the [EDDS (CBRT) API Documentation](https://evds2.tcmb.gov.tr/index.php?/evds/userDocs).
473-
2. Create an account on the EDDS website if you don't have one.
472+
1. Visit the [`EDDS` (CBRT) API Documentation](https://evds2.tcmb.gov.tr/index.php?/evds/userDocs).
473+
2. Create an account on the `EDDS` website if you don't have one.
474474
3. Follow the documentation to generate your API key.
475475

476476
### FRED (FED) API Key

Rsearch.Rproj

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: 3ac5526f-0b5b-4729-b003-8189c4542aca
23

34
RestoreWorkspace: Default
45
SaveWorkspace: Default

man/excel.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_series.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/lag_df.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/lag_df2.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)