The cleanest way to handle this is to not rely on the default automatic assignment behavior of getSymbols() 'and instead assign the time series object to more standard names of your choice. For instance:
HM.B.ST <- getSymbols("HM-B.ST", auto.assign=FALSE) # ht Joshua Ulrich chartSeries(HM.B.ST)
If for some reason you want time series to keep their hyphen name by default, you can access it by doing the following:
chartSeries(`HM-B.ST`)
The reason it works is because the return signals signal the R parser, that the characters between them should be parsed as one name (aka symbol), and not as two names separated by a subtraction operator.
To expand this point at home once and for all, try the following:
assign("a really stupidly constructed name!*&^", 5) `a really stupidly constructed name!*&^` # [1] 5
source share