-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata exploration.Rmd
80 lines (69 loc) · 2.28 KB
/
data exploration.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
---
title: "Genshin Attack Speed TC exploration"
author: "Rare Possum"
date: "17/05/2022"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(ggplot2)
```
## Plotting
```{r cars}
rm(list=ls())
setwd("D:/Other/Projects/ASexploration")
frames = read.csv("atkspeed2.csv", header=TRUE, colClasses=c("factor", "numeric", "numeric", "numeric", "numeric", "numeric"))
frames[,2]=frames[,2]/100
head(frames)
Shenhe = frames[frames$Char=="Shenhe",]
Chongyun = frames[frames$Char=="Chongyun",]
Razor = frames[frames$Char=="Razor",]
attach(frames)
```
```{r}
plot(RelAtkFrame~I(AtkSpd))
```
## Test plot
You can also embed plots, for example:
```{r pressure, echo=FALSE}
razor.lm = lm(Razor$RelAtkFrame~Razor$AtkSpd)
atkspd.lm = lm(RelAtkFrame~AtkSpd)
atkspd.ploy = lm(RelAtkFrame~poly(AtkSpd, 2))
atkspd.hyperbola = lm(RelAtkFrame~I(AtkSpd^-1))
atkspd.t = lm(RelAtkFrame~I(AtkSpd^-1)+poly(AtkSpd, 2))
summary(atkspd.lm)
summary(atksped.ploy)
summary(atkspd.hyperbola)
summary(atkspd.t)
ggplot(frames, aes(AtkSpd, RelAtkFrame))+geom_point()+geom_smooth(method="lm", level=0.99)
plot(RelAtkFrame~AtkSpd)
abline(atkspd.lm, col="red")
polypred = predict(atkspd.ploy)
ix= sort(AtkSpd, index.return=TRUE)$ix
lines(AtkSpd[ix], polypred[ix], col="blue")
hyperpred = predict(atkspd.hyperbola)
lines(AtkSpd[ix], hyperpred[ix], col="darkgreen")
tpred = predict(atkspd.t)
lines(AtkSpd[ix], tpred[ix], col="darkorchid2")
```
```{r noshenhe}
frames2= frames[frames$Char!="Shenhe",]
atkspd.lm = lm(frames2$RelAtkFrame~frames2$AtkSpd)
atkspd.ploy = lm(frames2$RelAtkFrame~poly(frames2$AtkSpd, 2))
atkspd.hyperbola = lm(frames2$RelAtkFrame~I(frames2$AtkSpd^-1))
atkspd.t = lm(frames2$RelAtkFrame~I(frames2$AtkSpd^-1)+poly(frames2$AtkSpd, 2))
summary(atkspd.lm)
summary(atksped.ploy)
summary(atkspd.hyperbola)
summary(atkspd.t)
ggplot(frames2, aes(AtkSpd, RelAtkFrame))+geom_point()+geom_smooth(method="lm", level=0.99)
plot(frames2$RelAtkFrame~frames2$AtkSpd)
abline(atkspd.lm, col="red")
polypred = predict(atkspd.ploy)
ix= sort(frames2$AtkSpd, index.return=TRUE)$ix
lines(frames2$AtkSpd[ix], polypred[ix], col="blue")
hyperpred = predict(atkspd.hyperbola)
#lines(frames2$AtkSpd[ix], hyperpred[ix], col="darkgreen")
tpred = predict(atkspd.t)
#lines(frames2$AtkSpd[ix], tpred[ix], col="darkorchid2")
```