diff --git a/03-cleaning.Rmd b/03-cleaning.Rmd index e98ec35..d1234e2 100644 --- a/03-cleaning.Rmd +++ b/03-cleaning.Rmd @@ -115,17 +115,19 @@ for (i in 16:nrow(USDT)){ ## Combine All the Value into One table -Finally, we combine the volatility, return, and market capitalization with the df.close1, creating the final table df.cryto +Finally, we combine the volatility, return, and market capitalization and volume with the df.close1, creating the final table df.crpyto ```{r} df.close1$Date<-rep(df.close$Date,5) -df.cryto<- +df.crpyto<- cbind(df.close1, market_cap=c(BTC$market_cap,BNB$market_cap,ETH$market_cap, USDC$market_cap,USDT$market_cap), return=c(BTC$Return,BNB$Return,ETH$Return,USDC$Return,USDT$Return), - volatility=c(BTC$Vol,BNB$Vol,ETH$Vol,USDC$Vol,USDT$Vol)) - + volatility=c(BTC$Vol,BNB$Vol,ETH$Vol,USDC$Vol,USDT$Vol), + volumn=c(BTC$total_volume,BNB$total_volume,ETH$total_volume, + USDC$total_volume,USDT$total_volume)) +df.crpyto$Date<-as.Date(df.crpyto$Date) ``` diff --git a/05-results.Rmd b/05-results.Rmd index 021d1a6..c5b5dc7 100644 --- a/05-results.Rmd +++ b/05-results.Rmd @@ -1,4 +1,5 @@ # Results + ```{r} ggplot(df.close1, aes(price)) + geom_boxplot() + coord_flip() + @@ -11,3 +12,21 @@ ggplot(df.close1, aes(price)) + plot(df.close[,2:6],pch=20, cex=0.1) ``` +```{r} +## plot volatility by crypto +ggplot(df.crpyto, aes(x=Date,y=volatility))+ + geom_line()+ + facet_wrap(~cryptocurrency,scales = "free") + + +``` + +```{r} +## plot volatility vs market capitalization +ggplot(df.crpyto, aes(x=market_cap,y=volatility))+ + geom_point(pch=5, cex=0.2)+ + facet_wrap(~cryptocurrency, scales = "free") +``` + + +