Learn R Programming

crypto (version 1.1.3)

crypto_xts: crypto_xts

Description

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

Usage

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.
    crypto_xts(df, '.5s')
    crypto_xts(df, 'sec')
    crypto_xts(df, 'second')
    crypto_xts(df, 'minute')
    crypto_xts(df, '5 mins')
    crypto_xts(df, 'hour')
    crypto_xts(df, '2 hours')
    crypto_xts(df, 'day')
    crypto_xts(df, 'week')
    crypto_xts(df, 'month')
    crypto_xts(df, 'bimonth')
    crypto_xts(df, '3 months')
    crypto_xts(df, 'halfyear')
    crypto_xts(df, 'year')
# }

Run the code above in your browser using DataLab