From 38f145f3a20e65bef077d1c5565911f870aaa544 Mon Sep 17 00:00:00 2001 From: msperlin Date: Fri, 16 Aug 2024 10:54:37 -0300 Subject: [PATCH] modifying examples for Cran submission --- CRAN-SUBMISSION | 4 ++-- R/dividends.R | 2 ++ R/financials.R | 2 ++ R/fundamentals.R | 2 ++ R/prices.R | 4 +++- R/splits.R | 3 ++- R/token.R | 2 ++ man/get_dividends.Rd | 2 ++ man/get_fundamentals.Rd | 2 ++ man/get_prices.Rd | 4 +++- man/get_splits.Rd | 3 ++- man/parse_financials.Rd | 2 ++ man/set_token.Rd | 2 ++ 13 files changed, 28 insertions(+), 6 deletions(-) diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 05bdae3..549c4c1 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ Version: 0.5.0 -Date: 2024-08-08 17:27:27 UTC -SHA: ea86eedd16cda0290ffcc72acb2d91c257dae3c5 +Date: 2024-08-16 13:49:57 UTC +SHA: fd4fb60e24f999bbbef39ade082e2f0fe3b88bf0 diff --git a/R/dividends.R b/R/dividends.R index 8722fb8..1ca7d94 100644 --- a/R/dividends.R +++ b/R/dividends.R @@ -13,9 +13,11 @@ #' @export #' #' @examples +#' \dontrun{ #' set_token(get_demo_token()) #' df_div <- get_dividends(ticker = "AAPL", exchange = "US") #' df_div +#' } get_dividends <- function(ticker = "AAPL", exchange = "US", cache_folder = get_default_cache(), check_quota = TRUE) { diff --git a/R/financials.R b/R/financials.R index ea95205..4146ea8 100644 --- a/R/financials.R +++ b/R/financials.R @@ -16,11 +16,13 @@ #' @export #' #' @examples +#' \dontrun{ #' set_token(get_demo_token()) #' l_out <- get_fundamentals(ticker = "AAPL", exchange = "US") #' #' df_fin <- parse_financials(l_out, "long") #' df_fin +#' } parse_financials <- function(l_out, type_table = "long") { possible_values <- c("long", "wide") diff --git a/R/fundamentals.R b/R/fundamentals.R index 80ad022..3cbae59 100644 --- a/R/fundamentals.R +++ b/R/fundamentals.R @@ -20,9 +20,11 @@ #' @export #' #' @examples +#' \dontrun{ #' set_token(get_demo_token()) #' l_out <- get_fundamentals(ticker = "AAPL", exchange = "US") #' names(l_out) +#' } get_fundamentals <- function(ticker = "AAPL", exchange = "US", cache_folder = get_default_cache(), diff --git a/R/prices.R b/R/prices.R index e273b7c..566b000 100644 --- a/R/prices.R +++ b/R/prices.R @@ -9,8 +9,10 @@ #' @export #' #' @examples -#' set_token("demo") +#' \dontrun{ +#' set_token(get_demo_token()) #' df_prices <- get_prices(ticker = "AAPL", exchange = "US") +#' } get_prices <- function(ticker = "AAPL", exchange = "US", cache_folder = get_default_cache(), diff --git a/R/splits.R b/R/splits.R index f51d178..18f8d87 100644 --- a/R/splits.R +++ b/R/splits.R @@ -9,7 +9,8 @@ #' @export #' #' @examples -#' \dontrun{# requires a subscription (paid) token +#' \dontrun{ +#' # requires a subscription (paid) token #' df_split <- get_splits(ticker = "AAPL", exchange = "US") #' } get_splits <- function(ticker = "AAPL", exchange = "US", diff --git a/R/token.R b/R/token.R index 3a4dae6..3da39f2 100644 --- a/R/token.R +++ b/R/token.R @@ -10,7 +10,9 @@ #' @export #' #' @examples +#' \dontrun{ #' set_token() +#' } set_token <- function(token = get_demo_token()) { Sys.setenv("eodhd-token" = token) diff --git a/man/get_dividends.Rd b/man/get_dividends.Rd index 37563ea..fae6f5d 100644 --- a/man/get_dividends.Rd +++ b/man/get_dividends.Rd @@ -36,7 +36,9 @@ This function will query the dividend end point } } \examples{ +\dontrun{ set_token(get_demo_token()) df_div <- get_dividends(ticker = "AAPL", exchange = "US") df_div } +} diff --git a/man/get_fundamentals.Rd b/man/get_fundamentals.Rd index 4071358..72d05e3 100644 --- a/man/get_fundamentals.Rd +++ b/man/get_fundamentals.Rd @@ -38,7 +38,9 @@ return a list. The raw data includes: } } \examples{ +\dontrun{ set_token(get_demo_token()) l_out <- get_fundamentals(ticker = "AAPL", exchange = "US") names(l_out) } +} diff --git a/man/get_prices.Rd b/man/get_prices.Rd index 482f69b..01fe5cd 100644 --- a/man/get_prices.Rd +++ b/man/get_prices.Rd @@ -31,6 +31,8 @@ This function will query the price end point of eodhd and return daily stock pri It also includes the daily stock return (percentage variation). } \examples{ -set_token("demo") +\dontrun{ +set_token(get_demo_token()) df_prices <- get_prices(ticker = "AAPL", exchange = "US") } +} diff --git a/man/get_splits.Rd b/man/get_splits.Rd index d9a88f3..023681d 100644 --- a/man/get_splits.Rd +++ b/man/get_splits.Rd @@ -30,7 +30,8 @@ A dataframe with split information This function will query the splits end point of eodhd and return all split information for a given stock/exchange. } \examples{ -\dontrun{# requires a subscription (paid) token +\dontrun{ +# requires a subscription (paid) token df_split <- get_splits(ticker = "AAPL", exchange = "US") } } diff --git a/man/parse_financials.Rd b/man/parse_financials.Rd index be7a0f5..86fa5cf 100644 --- a/man/parse_financials.Rd +++ b/man/parse_financials.Rd @@ -23,9 +23,11 @@ Cashflow statement and Income statement. Whenever no financial data is found in l_out, the function returns an empty dataframe. } \examples{ +\dontrun{ set_token(get_demo_token()) l_out <- get_fundamentals(ticker = "AAPL", exchange = "US") df_fin <- parse_financials(l_out, "long") df_fin } +} diff --git a/man/set_token.Rd b/man/set_token.Rd index 043070f..6df227a 100644 --- a/man/set_token.Rd +++ b/man/set_token.Rd @@ -18,5 +18,7 @@ Uses the token from \url{https://eodhd.com/cp/dashboard} to authenticate your R Alternatively, a demo token is also available for testing purposes, with a limited supply of data. } \examples{ +\dontrun{ set_token() } +}