Open englianhu opened 1 year ago
# --------- eval = FALSE ---------
## 检验是否已设置途径。
if (!exists('.蜀道')) {
.蜀道 <- getwd() |>
{\(.) str_split(., '/')}() |>
{\(.) c('/', .[[1]][2:5])}() |>
{\(.) c(., 'binary.com-interview-question-data/')}() |>
{\(.) paste(., collapse = '/')}() |>
{\(.) substring(., 2)}()
}
if (!exists('.蜀道仓库')) {
.蜀道仓库 <- paste0(.蜀道, '文艺数据库/fx/USDJPY/仓库/')
}
## 倘若环境尚未有数据,读取文件数据。
if (!exists('样本')) {
样本 <- readRDS(paste0(.蜀道, '文艺数据库/fx/USDJPY/样本1.rds'))
}
✖ 3.6 GiB [世博量化研究院*]❯ 样本 %>% filter(is.na(闭市价))
Source: local data table [7,200 x 12]
Call: `_DT2`[is.na(闭市价)]
年月日时分 年份 季度 月份 周 周日 周分计 日分计 时分计 序列 日期
<dttm> <dbl> <int> <int> <dbl> <chr> <int> <int> <int> <int> <date>
1 2018-01-02 00:01:00 2017 1 1 53 周二 1 1 1 1123201 2018-01-02
2 2018-01-02 00:02:00 2017 1 1 53 周二 3 3 3 1123203 2018-01-02
3 2018-01-02 00:03:00 2017 1 1 53 周二 5 5 5 1123205 2018-01-02
4 2018-01-02 00:04:00 2017 1 1 53 周二 7 7 7 1123207 2018-01-02
5 2018-01-02 00:05:00 2017 1 1 53 周二 9 9 9 1123209 2018-01-02
6 2018-01-02 00:06:00 2017 1 1 53 周二 11 11 11 1123211 2018-01-02
# … with 7,194 more rows, and 1 more variable: 闭市价 <dbl>
# ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names
# Use as.data.table()/as.data.frame()/as_tibble() to access results
Warning messages:
1: In format.POSIXlt(as.POSIXlt(x, tz), format, usetz, ...) :
NAs introduced by coercion to integer range
2: In format.POSIXlt(as.POSIXlt(x, tz), format, usetz, ...) :
NAs introduced by coercion to integer range
3: In format.POSIXlt(as.POSIXlt(x, tz), format, usetz, ...) :
NAs introduced by coercion to integer range
4: In format.POSIXlt(as.POSIXlt(x, tz), format, usetz, ...) :
NAs introduced by coercion to integer range
5: In format.POSIXlt(as.POSIXlt(x, tz), format, usetz, ...) :
NAs introduced by coercion to integer range
6: In format.POSIXlt(as.POSIXlt(x, tz), format, usetz, ...) :
NAs introduced by coercion to integer range
✖ 3.6 GiB [世博量化研究院*]❯ 样本 %>% filter(is.na(闭市价)) %>% data.frame
年月日时分 年份 季度 月份 周 周日 周分计 日分计 时分计 序列 日期 闭市价
1 2018-01-02 00:01:00 2017 1 1 53 周二 1 1 1 1123201 2018-01-02 NA
2 2018-01-02 00:02:00 2017 1 1 53 周二 3 3 3 1123203 2018-01-02 NA
3 2018-01-02 00:03:00 2017 1 1 53 周二 5 5 5 1123205 2018-01-02 NA
4 2018-01-02 00:04:00 2017 1 1 53 周二 7 7 7 1123207 2018-01-02 NA
5 2018-01-02 00:05:00 2017 1 1 53 周二 9 9 9 1123209 2018-01-02 NA
6 2018-01-02 00:06:00 2017 1 1 53 周二 11 11 11 1123211 2018-01-02 NA
7 2018-01-02 00:07:00 2017 1 1 53 周二 13 13 13 1123213 2018-01-02 NA
8 2018-01-02 00:08:00 2017 1 1 53 周二 15 15 15 1123215 2018-01-02 NA
[ reached 'max' / getOption("max.print") -- omitted 7192 rows ]
✖ 3.6 GiB [世博量化研究院*]❯ 样本 %>% filter(is.na(闭市价)) %>% data.frame %>% tail
年月日时分 年份 季度 月份 周 周日 周分计 日分计 时分计 序列 日期 闭市价
7195 2018-01-06 23:55:00 2017 1 1 53 周六 7189 1429 49 1137589 2018-01-06 NA
7196 2018-01-06 23:56:00 2017 1 1 53 周六 7191 1431 51 1137591 2018-01-06 NA
7197 2018-01-06 23:57:00 2017 1 1 53 周六 7193 1433 53 1137593 2018-01-06 NA
7198 2018-01-06 23:58:00 2017 1 1 53 周六 7195 1435 55 1137595 2018-01-06 NA
7199 2018-01-06 23:59:00 2017 1 1 53 周六 7197 1437 57 1137597 2018-01-06 NA
7200 2018-01-07 00:00:00 2017 1 1 53 周日 7199 1439 59 1137599 2018-01-07 NA
骇客入侵,人为因素:样本$年月日时分 %<>% ymd_hms(tz = 'Asia/Shanghai')
或样本$年月日时分 %<>% as_datetime
还是出现警讯,倘若样本[, 年月日时分 := format(年月日时分, '%Y-%m-%d %H:%M:%S', tz = 'Asia/Shanghai', usetz = TRUE)]
日期格式就转成了文本。
议题
《大秦赋》 忧从巫来,不可断绝; 何以解忧,唯有除巫。 秦人牧马,始于汧渭; 巫裔尽弃,瓦釜雷鸣。
上奏天朝:时间序列议题如上,而相关案例如下。
操作系统
相关资源: