diff --git a/03-cleaning.Rmd b/03-cleaning.Rmd index e98ec35..9c19b24 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.crypto<- 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), + volume=c(BTC$total_volume,BNB$total_volume,ETH$total_volume, + USDC$total_volume,USDT$total_volume)) +df.crypto$Date<-as.Date(df.crypto$Date) ``` diff --git a/04-missing.Rmd b/04-missing.Rmd index 2c9cdd4..81b1892 100644 --- a/04-missing.Rmd +++ b/04-missing.Rmd @@ -5,13 +5,13 @@ library(redav) ``` ```{r} -plot_missing(df.cryto) +plot_missing(df.crpyto) ``` Observed that volatility and return contains missing values. Take a look into number of missing value in columns we found: ```{r} -colSums(is.na(df.cryto)) %>% +colSums(is.na(df.crypto)) %>% sort(decreasing = TRUE) ``` diff --git a/05-results.Rmd b/05-results.Rmd index 021d1a6..6e6b2f1 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,27 @@ ggplot(df.close1, aes(price)) + plot(df.close[,2:6],pch=20, cex=0.1) ``` +```{r} +## plot volatility by crypto +ggplot(df.crypto, aes(x=Date,y=volatility))+ + geom_line()+ + facet_wrap(~cryptocurrency,scales = "free") + + +``` + +```{r} +## plot volatility vs market capitalization +ggplot(df.crypto, aes(x=market_cap,y=volatility))+ + geom_point(pch=5, cex=0.2)+ + facet_wrap(~cryptocurrency, scales = "free") +``` +```{r} +ggplot(rbind(df.crypto[df.crypto$cryptocurrency=="USDC",], + df.crypto[df.crypto$cryptocurrency=="USDT",]), + aes(Date, volume)) + geom_col()+ + facet_wrap(~cryptocurrency,scales="free") +``` + + +