[et_pb_section admin_label="section"][et_pb_row admin_label="row"][et_pb_column type="4_4"][et_pb_text admin_label="Texto" background_layout="light" text_orientation="justified" text_font="Verdana||||" text_font_size="18" use_border_color="off" border_color="#ffffff" border_style="solid"]
E o bitcoin continua surpreendendo, hein? Colocamos abaixo novamente como baixar dados da criptomoeda com o R.
library(Quandl) library(ggplot2) library(forecast) library(scales) btc = Quandl("BCHARTS/ROCKUSD", type='xts') bitcoin = btc$Close bitcoin = apply.monthly(bitcoin, FUN=mean) time = seq(as.Date('2016-01-01'), as.Date('2017-11-01'), by='1 month') data = data.frame(time=time, bitcoin=tail(bitcoin[,2],12+11)) ggplot(data, aes(x=time, y=Close))+ geom_bar(stat='identity', size=.7, colour='darkblue', fill='darkblue')+ geom_text(aes(label=round(Close,0)), size=2.8, hjust=0.5, vjust=-0.5, shape=21, colour="red")+ scale_x_date(breaks = date_breaks("1 months"), labels = date_format("%m/%Y"))+ theme(axis.text.x=element_text(angle=45, hjust=1))+ xlab('')+ylab('')+ labs(title='Bitcoin vs. USD ', subtitle='(Fechamento Diário mensalizado)', caption='Fonte: analisemacro.com.br com dados Quandl R API.')
Onde vai para o bitcoin? 🙂
[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row admin_label="row"][et_pb_column type="1_2"][et_pb_image admin_label="Imagem" src="https://analisemacro.com.br/wp-content/uploads/2017/11/datascience2.png" show_in_lightbox="off" url="https://analisemacro.com.br/cursos-de-r/" url_new_window="off" use_overlay="off" animation="left" sticky="off" align="left" force_fullwidth="off" always_center_on_mobile="on" use_border_color="off" border_color="#ffffff" border_style="solid" /][/et_pb_column][et_pb_column type="1_2"][et_pb_image admin_label="Imagem" src="https://analisemacro.com.br/wp-content/uploads/2017/11/datascience.png" show_in_lightbox="off" url="https://analisemacro.com.br/cursos-de-r/" url_new_window="off" use_overlay="off" animation="left" sticky="off" align="left" force_fullwidth="off" always_center_on_mobile="on" use_border_color="off" border_color="#ffffff" border_style="solid" /][/et_pb_column][/et_pb_row][/et_pb_section]