Description Usage Arguments Details Value Examples
Converts Investment file from rosstat to tibble
1 2 3 4 5 | convert_1_06_0_xlsx(
path_to_source = "http://www.gks.ru/bgd/regl/b20_02/IssWWW.exe/Stg/d010/1-06-0.xlsx",
access_date = Sys.Date(),
sheet = 1
)
|
path_to_source |
name of the original 1-06-0.xls file |
access_date |
date of access is appended to every observation |
sheet |
number of sheet, 1 by default |
Converts Investment file from rosstat to tibble Written by Rifat Eniliev
tibble
1 2 3 4 5 6 7 8 9 10 11 12 | invest = convert_1_06_0_xlsx()
# convert_1_06_0_xlsx = function(path_to_source = "http://www.gks.ru/bgd/regl/b20_02/IssWWW.exe/Stg/d010/1-06-0.xlsx", access_date = Sys.Date()) {
# data = rio::import(path_to_source)
# data_vector = data[4:23, 3:6] %>% t() %>% as.vector()
# colnames(data_vector) = NULL
# data_ts = stats::ts(data_vector, start = c(1999, 1), freq = 4)
# data_tsibble = tsibble::as_tsibble(data_ts) %>% dplyr::rename(date = index, invest = value)
# data_tsibble = dplyr::mutate(data_tsibble, access_date = access_date, date = as.Date(date))
# check_conversion(data_tsibble)
# return(data_tsibble)
# }
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.