2020年1月21日火曜日

EPS 2020JAN21


old data.

> eps_year_xts["2019::"]
             [,1]
2019-01-01 134.39
2019-04-01 135.27
2019-07-01 132.90
2019-10-01 140.45
2020-01-01 142.40
2020-04-01 147.35
2020-07-01 156.01
2020-10-01 161.87

Downloads$ tac eps.txt 
3/31/2019 2834.40 $37.99 $35.02 18.52 21.09 $153.05 $134.39
6/30/2019 2941.76 $40.14 $34.93 19.04 21.75 $154.54 $135.27
9/30/2019  2976.74 $39.81 $33.99 19.46 22.40 $152.97 $132.90
12/31/2019 (12.1%) 3230.78 $40.09 $36.30 20.99 23.65 $158.03 $140.24
3/31/2020 $40.15 $36.63 20.71 23.38 $160.19 $141.85
6/30/2020 $43.39 $39.54 20.29 22.65 $163.44 $146.46
9/30/2020 $45.71 $42.43 19.59 21.41 $169.34 $154.91
12/31/2020 $45.91 $42.31 18.94 20.61 $175.16 $160.92
3/31/2021 $44.28 $40.65 18.50 20.11 $179.29 $164.94
6/30/2021 $47.43 $41.75 18.09 19.84 $183.33 $167.14
9/30/2021 $49.44 $44.52 17.73 19.60 $187.06 $169.22
12/31/2021 $50.07 $44.31 17.35 19.37 $191.22 $171.23


Downloads$ tac eps.txt | awk '{gsub("\\$","",$NF);print "eps_year_xts[\"2019::\"]["NR"] <- "$NF}'
eps_year_xts["2019::"][1] <- 134.39
eps_year_xts["2019::"][2] <- 135.27
eps_year_xts["2019::"][3] <- 132.90
eps_year_xts["2019::"][4] <- 140.24
eps_year_xts["2019::"][5] <- 141.85
eps_year_xts["2019::"][6] <- 146.46
eps_year_xts["2019::"][7] <- 154.91
eps_year_xts["2019::"][8] <- 160.92
eps_year_xts["2019::"][9] <- 164.94
eps_year_xts["2019::"][10] <- 167.14
eps_year_xts["2019::"][11] <- 169.22
eps_year_xts["2019::"][12] <- 171.23

This cause error as the entris for "2021" don't exit in the object at the time. Then, the entries should be appended beforehand.


> eps_year_xts <- append(eps_year_xts,as.xts(c(146.46,154.91,160.92,164.94),seq(as.Date("2021-01-01"),as.Date("2021-10-01"),by='quarters')))


<skip>
2019-10-01 140.24000
2020-01-01 141.85000
2020-04-01 146.46000
2020-07-01 154.91000
2020-10-01 160.92000
2021-01-01 146.46000
2021-04-01 154.91000
2021-07-01 160.92000

2021-10-01 164.94000

0 件のコメント: