# NOT RUN {
dts = md_stock(c('000001', '^000001'), source = '163')
# set freq
dts_returns1 = pq_return(dts, freq = 'all')
dts_returns2 = pq_return(dts, freq = 'weekly')
# set method
dts_returns3 = pq_return(dts, freq = 'monthly', method = 'arithmetic') # default method
dts_returns4 = pq_return(dts, freq = 'monthly', method = 'log')
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab