From 9a4ede659656eb40bb890afa3d64b8855acd5c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=92=A7=E5=A4=A9?= Date: Wed, 4 May 2022 20:15:02 -0400 Subject: [PATCH] 1111 --- 03-cleaning.Rmd | 10 ++++++---- 05-results.Rmd | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) 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") +``` + + +