Skip to content

Commit

Permalink
fixed issue #19
Browse files Browse the repository at this point in the history
  • Loading branch information
msperlin committed Nov 27, 2020
1 parent 2d5e59a commit fb76ce9
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 13 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: BatchGetSymbols
Title: Downloads and Organizes Financial Data for Multiple Tickers
Version: 2.6
Version: 2.6.1
Authors@R: person("Marcelo", "Perlin", email = "marceloperlin@gmail.com", role = c("aut", "cre"))
Description: Makes it easy to download financial data from Yahoo Finance <https://finance.yahoo.com/>.
Date: 2020-11-22
Date: 2020-11-27
Depends:
R (>= 3.4.0), rvest, dplyr
Imports: stringr, curl, quantmod, XML, tidyr,
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Version 2.6.1 (2020-11-27)

- Fixed issue [issue 19](https://github.com/msperlin/BatchGetSymbols/issues/19), which only happened in Windows.
- changed default cache dir for ticker grabbing function

## Version 2.6 (2020-11-22)

- The cache system is now session-persistent with `cache.dir = file.path(tempdir(), 'BGS_Cache')`. This solves the problem with mismatching price series from cached data between splits or dividends. A new warning is set whenever the user uses cache.dir different from temp.dir()
Expand Down
5 changes: 0 additions & 5 deletions R/BatchGetSymbols.R
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,8 @@ BatchGetSymbols <- function(tickers,
df.tickers = df.tickers)

# check if cach folder is tempdir()
<<<<<<< HEAD
flag <- stringr::str_detect(string = cache.folder,
pattern = tempdir())
=======
flag <- stringr::str_detect(cache.folder,
pattern = stringr::fixed(tempdir()))
>>>>>>> 63694a0635c7d0bca8688ddb652d150a28354f98

if (!flag) {
warning(stringr::str_glue('\nIt seems you are using a non-default cache folder at {cache.folder}. ',
Expand Down
3 changes: 2 additions & 1 deletion R/GetFTSE100Stocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ GetFTSE100Stocks <- function(do.cache = TRUE,
cache.folder = file.path(tempdir(),
'BGS_Cache')){

cache.file <- file.path(cache.folder, paste0('FTSE100_Composition_', Sys.Date(), '.rds') )
cache.file <- file.path(cache.folder,
paste0('FTSE100_Composition_', Sys.Date(), '.rds') )

if (do.cache) {
# check if file exists
Expand Down
3 changes: 2 additions & 1 deletion R/GetSP500Stocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ GetSP500Stocks <- function(do.cache = TRUE,
cache.folder = file.path(tempdir(),
'BGS_Cache')){

cache.file <- file.path(cache.folder, paste0('SP500_Composition_', Sys.Date(), '.rds') )
cache.file <- file.path(cache.folder,
paste0('SP500_Composition_', Sys.Date(), '.rds') )

if (do.cache) {
# check if file exists
Expand Down
3 changes: 2 additions & 1 deletion R/Get_Ibov_Stocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ GetIbovStocks <- function(do.cache = TRUE,
'BGS_Cache'),
max.tries = 10){

cache.file <- file.path(cache.folder, paste0('Ibov_Composition_', Sys.Date(), '.rds') )
cache.file <- file.path(cache.folder,
paste0('Ibov_Composition_', Sys.Date(), '.rds') )

# get list of ibovespa's tickers from wbsite

Expand Down
5 changes: 4 additions & 1 deletion man/GetFTSE100Stocks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/GetIbovStocks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/GetSP500Stocks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fb76ce9

Please sign in to comment.