-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautotrader.R
More file actions
15 lines (10 loc) · 853 Bytes
/
autotrader.R
File metadata and controls
15 lines (10 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
tesla <- read.csv('dataset.processed.csv')
library(ggplot2)
tesla$year <- factor(tesla$year)
ggplot(tesla, aes(miles, price, color=year)) + geom_point() + geom_smooth(method = lm, se = FALSE)
ggplot(tesla, aes(miles, price, color=year, size=battery, shape=factor(awd))) + geom_point() + scale_color_discrete('year') + scale_size('battery size', range=c(0.5,3)) + scale_shape_manual('AWD', values=c(1,16))
ggplot(tesla, aes(miles, price, color=factor(performance))) + geom_point() + geom_smooth(method = lm, se = FALSE)
ggplot(tesla, aes(miles, price, color=factor(awd))) + geom_point() + geom_smooth(method = lm, se = FALSE)
ggplot(tesla, aes(miles, price, color=battery)) + geom_point() + scale_color_continuous('battery') + facet_grid(. ~ year)
options("scipen"=100, "digits"=4)
m <- lm(price ~ year * miles + performance + awd + battery, tesla)