Description Usage Arguments Value Examples
View source: R/scrape_onefirm.r
Calculate the number of pages required
to get all stock price data for one brand,
and execute scrape_onepage
for each page using the loop syntax.
At this time, in order to avoid the load on the server,
after finishing scraping for one page,
wait one second and execute scraping for the next page.
Use the bind_rows
of the dplyr package
o connect the stock price data on each page in the row direction.
1 | scrape_onefirm(code, name = NULL, start_date, end_date, datatype)
|
code |
numeric. Specify a brand code |
name |
character. Specify company name.
If specified, ignore |
start_date |
numeric. Specify the start date of the stock price data you want to acquire in the format of yyyymmdd. |
end_date |
numeric. Specify the end date of the stock price data you want to acquire in the format of yyyymmdd. |
datatype |
character. Specify the type of stock price data.
If |
A tibble data containing stock price data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Acquire 2014 daily stock price data of Sony Group (brand code 6758)
scrape_onefirm(
6758,
start_date = 20140101,
end_date = 20141231,
datatype = "d"
)
# Acquire 2014 monthly stock price data of APAMAN
scrape_onefirm(
name = "APAMAN",
start_date = 20140101,
end_date = 20141231,
datatype = "m"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.