Skip to content

Add warning for tickers that are reserved words #401

Closed
@joshuaulrich

Description

@joshuaulrich

Some tickers are reserved words in R (see ?reserved). Throw a (optional) warning when a user requests one of these tickers.

quantmod::getSymbols(c("NA", "TRUE"))
NA    # [1] NA
TRUE  # [1] TRUE

`NA`
##            NA.Open NA.High NA.Low NA.Close NA.Volume NA.Adjusted
## 2022-07-12    7.61  13.390  7.510    12.05   1486800       12.05
## 2022-07-13    9.77  12.000  8.800     8.80    264400        8.80
## 2022-07-14    8.01   8.260  6.321     7.35    134100        7.35
## 2022-07-15    7.64   7.820  6.800     6.80     47000        6.80
## 2022-07-18    6.45   8.490  6.300     6.70     69400        6.70
## 2022-07-19    6.72   7.515  6.710     7.42     39200        7.42
## 2022-07-20    6.54   8.300  6.330     7.73    190700        7.73
## 2022-07-21    7.70   8.000  7.080     8.00     28000        8.00
## 2022-07-22    7.91   7.910  6.688     6.79     37500        6.79
## 2022-07-25    7.10  13.000  7.010    10.56   4532500       10.56
##        ...
## 2023-08-03    1.67   1.670  1.400     1.44     55700        1.44
## 2023-08-04    1.48   1.520  1.380     1.44    124000        1.44
## 2023-08-07    1.41   1.440  1.300     1.30     83100        1.30
## 2023-08-08    1.25   1.460  1.250     1.38    117200        1.38
## 2023-08-09    1.35   1.420  1.310     1.33     39100        1.33
## 2023-08-10    1.33   1.394  1.280     1.28     34000        1.28
## 2023-08-11    1.35   1.350  1.190     1.22    100400        1.22
## 2023-08-14    1.19   1.328  1.140     1.29     81600        1.29
## 2023-08-15    1.29   1.290  1.080     1.20     48600        1.20
## 2023-08-16    1.13   1.151  1.050     1.06     70800        1.06

`TRUE`
##            TRUE.Open TRUE.High TRUE.Low TRUE.Close TRUE.Volume TRUE.Adjusted
## 2014-05-16      9.70    10.760    9.590     10.060     6568800        10.060
## 2014-05-19     10.40    10.490    9.500      9.900      888100         9.900
## 2014-05-20      9.76     9.850    9.500      9.500      398800         9.500
## 2014-05-21      9.51     9.700    9.500      9.625      264300         9.625
## 2014-05-22      9.75     9.750    9.210      9.310      459400         9.310
## 2014-05-23      9.31     9.380    9.050      9.220      226500         9.220
## 2014-05-27      9.65    10.200    9.351     10.200      546700        10.200
## 2014-05-28     10.53    10.710   10.250     10.440      397100        10.440
## 2014-05-29     10.88    11.000   10.500     10.560      548700        10.560
## 2014-05-30     11.50    11.500   10.820     10.960      322200        10.960
##        ...
## 2023-08-03      2.28     2.510    2.280      2.450      555200         2.450
## 2023-08-04      2.46     2.490    2.310      2.320      162100         2.320
## 2023-08-07      2.33     2.350    2.280      2.340      117700         2.340
## 2023-08-08      2.31     2.345    2.275      2.310       77500         2.310
## 2023-08-09      2.31     2.335    2.260      2.260      139600         2.260
## 2023-08-10      2.27     2.320    2.170      2.200      156500         2.200
## 2023-08-11      2.19     2.260    2.170      2.250      121500         2.250
## 2023-08-14      2.24     2.290    2.210      2.270       90500         2.270
## 2023-08-15      2.26     2.260    2.200      2.210      109500         2.210
## 2023-08-16      2.19     2.265    2.160      2.160      140500         2.160

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions