getEarnings: download historic earnings and earnings estimates for a given...

Description Usage Arguments Details Value References See Also Examples

View source: R/getEarnings.R

Description

download historic earnings and earnings estimates for a given stock from http://earnings.com. One of the columns of the data.frame will be the Dates/Times of the earnings release. These Dates/Times may have one of a few different formats, most of which are ambiguous. convertEarningsTime will put the Dates/Times in an unambiguous format; it will be called if getEarnings is called with doFormatTime = TRUE.

Usage

1
2
3
4
5
6
  getEarnings(Symbol, doFormatTime = TRUE,
    return.tz = "America/Chicago",
    return.class = c("xts", "data.frame"))

  convertEarningsTime(x, date.format = "%d-%b-%y",
    default.time = "AMC", return.tz = "America/Chicago")

Arguments

Symbol

character string ticker symbol of stock

doFormatTime

should the values of the Date/Time be re-formatted? (TRUE)

return.tz

timezone in which to represent Date/Time of earnings release. ignored if doFormatTime is not TRUE

return.class

can be one of “xts” or “data.frame”.

x

character string representing a time or date

date.format

format of the date

default.time

what time to use if x is only a date. “AMC” stands for After Market Close and will become “16:00:00” New York time. “BMO” stands for Before Market Open and will become “07:00:00” New York time.

Details

If one of the earnings Date/Time values contains “BMO” or “AMC”, it will be substituted with “07:00:00” and “16:15:00”, respectively in New York time.

Value

for getEarnings, it depends on return.class; If it is “xts”, an xts object will be returned that will only contain the numeric columns: “EPS.ESTIMATE”, “EPS.ACTUAL”, and “PREV.YEAR.ACTUAL”. If return.class is “data.frame”, a data.frame will be returned that, in addition to the columns of the xts, also contain columns “Symbol”, “PERIOD”, “EVENT.TITLE”, and “TIME”.

convertEarningsTime will return a string representing a date and time. in the format “%Y-%m-%d %H:%M%:S %Z”

References

http://earnings.com

See Also

getHoldings, getFinancials, getDividends, get_div, getSplits, get_spl,

strftime for formats

Examples

1
2
3
4
5
6
## Not run: 
getEarnings('GOOG')
getEarnings("GOOG", return.class='data.frame')
getEarnings("GOOG", return.class='data.frame', doFormatTime=FALSE)

## End(Not run)

qmao documentation built on May 2, 2019, 4:54 p.m.