-
Notifications
You must be signed in to change notification settings - Fork 0
/
Report1_bernaue2.Rmd
138 lines (84 loc) · 4.06 KB
/
Report1_bernaue2.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---
title: "Project_Report_1"
author: "Andrew Bernauer"
date: "January 25, 2019"
output: html_document
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE, cache=TRUE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
```{r}
library(ggplot2)
library(lubridate)
library(purrr)
library(dplyr)
library(readr)
library(tibble)
library(errorist)
ethereum_transaction_history <- read_csv("C:\\Users\\andre\\Documents\\ECON_490_ML\\ML_report 1\\ethereum-historical-data\\EthereumTransactionHistory.csv",
col_types = cols(
date = col_character(),
UnixTimeStamp = col_number(),
transaction_history = col_number()
), col_names = TRUE, browseEnv(), guess_max = 1002)
date_utc <- mdy(ethereum_transaction_history$`Date(UTC)`)
dat_u_time <- as_datetime(ethereum_transaction_history$UnixTimeStamp, origin = lubridate::origin, tz = "UTC")
day_of_week <- lubridate::wday(dat_u_time)
##%>% select(ethereum_transaction_history, , 'UnixTimeStamp', 'Value')
##select(ethereum_transaction_history, ethereum_transaction_history$`Date(UTC)`)
time_unix <- lubridate::as_datetime(ethereum_transaction_history$UnixTimeStamp, origin = lubridate::origin, tz = "UTC")
summary(time_unix)
##day_week <- lubridate::wday(as_date(ethereum_transaction_history$`Date(UTC)`, tz = "UTC", format = NULL))
a_1 <- ggplot(data = ethereum_transaction_history, mapping = aes(dat_u_time, ethereum_transaction_history$Value)) +
geom_jitter(width = 0.25, height = 0.25) +
stat_smooth(span = 0.4)
a_1
##ethereum_transaction_history
##summarise(ethereum_transaction_history$`Date(UTC)`)
am_eth <- lubridate::am(time_unix)
month_eth <- lubridate::month(date_utc)
wrap_by <- function(...){
facet_wrap(vars(...), labeller = label_both)
}
#a_1 + wrap_by(month_eth)
#ether_supply_growth <- read_csv("ethereum-historical-data\\EtherSupplyGrowthChart.csv", col_names = c('date', 'unix_tstamp', 'supply_growth'))
##ether_supply_growth <- read_csv("ethereum-historical-data\\EtherSupplyGrowthChart.csv", col_names = c('date', 'unix_tstamp', 'supply_growth'))
ether_network_hashrate <- read_csv("C:\\Users\\andre\\Documents\\ECON_490_ML\\ML_report 1\\ethereum-historical-data\\EthereumNetworkHashRateGrowthRate.csv", col_names = c('date', 'unix_tstamp', 'hashrate'), col_types = list(col_date(), col_number(), col_double()), browser())
l_ether <- list(day = day_of_week, month = month_eth, Date = ethereum_transaction_history$`Date(UTC)`, time_stamp = ethereum_transaction_history$UnixTimeStamp, transaction_history = ethereum_transaction_history$Value, hash_rate = EthereumNetworkHashRateGrowthRate$Value, price = EthereumPriceHistory_USD_$value, blocksize = EthereumBlockSizeHistory$Value )
df_ether <- as_tibble(l_ether)
#summarise_(df_ether)
mon_plot <- ggplot(df_ether, mapping = aes(month, price))+
geom_point() +
geom_point(alpha = 0.05) +
facet_wrap(vars(day))
mon_plot
price_plo <- ggplot(df_ether, mapping = aes(day, price))+
geom_point() +
facet_wrap(vars(month)) +
geom_smooth(method = lm)
price_plo
plt_price_transaction <- ggplot(df_ether, mapping = aes(transaction_history, price))+
geom_line()
plt_price_block
plt_price_hash <- ggplot(df_ether, mapping = aes(hash_rate, price)) +
geom_area(colour = "purple")
plt_price_hash
plt_lin_price <- ggplot(df_ether, mapping = aes(month, price)) +
geom_line() +
geom_step()
plt_lin_price
price_hist <- ggplot(data = df_ether, aes(price) ) +
geom_histogram(binwidth = 1300)
price_hist
```