Learn R Programming

crypto (version 1.0.3)

crypto2xts: crypto2xts

Description

Converts the getCoins() dataframe into an xts object. Provide frequency to summarise into specific time periods.

Usage

crypto2xts(df, frequency = NULL)

crypto_xts(df, frequency = NULL)

Arguments

df

data.frame from getCoins()

frequency

string ?round_date for help

Value

xts

Examples

Run this code
# NOT RUN {
  
# }
# NOT RUN {
 You can lookup additional frequencies at \code{?round_date}
 from the lubridate package.
    crypto2xts(df, '.5s')
    crypto2xts(df, 'sec')
    crypto2xts(df, 'second')
    crypto2xts(df, 'minute')
    crypto2xts(df, '5 mins')
    crypto2xts(df, 'hour')
    crypto2xts(df, '2 hours')
    crypto2xts(df, 'day')
    crypto2xts(df, 'week')
    crypto2xts(df, 'month')
    crypto2xts(df, 'bimonth')
    crypto2xts(df, '3 months')
    crypto2xts(df, 'halfyear')
    crypto2xts(df, 'year')
# }

Run the code above in your browser using DataLab