-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
106 lines (70 loc) · 4.34 KB
/
README.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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# mercedestrenzr
<!-- badges: start -->
[![R-CMD-check](https://github.com/UBC-MDS/mercedestrenzr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/UBC-MDS/mercedestrenzr/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/UBC-MDS/mercedestrenzr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/UBC-MDS/mercedestrenzr?branch=main)
<!-- badges: end -->
The goal of mercedestrenzr is to inspect and analyze used Mercedes Benz car prices. The package helps users to get simple answers on how to choose the used Mercedes Benz car in the market. The package also includes useful visualization tool and trained model to serve buyers and sellers.
# Collaborators
Kelly Wu, Morris Zhao, Spencer Gerlach, Ty Andrews
# R ecosystem
Our package is unique in the r package ecosystem. It provides an easy way to investigate used Mercedes Benz car prices. It provide people a big picture about the market. The package is rely on the real market data set to plot, filter and predict. It also gives advice to buyers and seller when they try to make a decision.
Our package is the first package in cran that focus on analyzing the market trend of Mercedes-Benz. This is a pilot project on streamlining the data analysis process of used cars market. This package could serve as the foundation for bigger projects in the future that extend the scope beyond a single car brand and leverage web scrapping techniques to enhance the dataset.
# Functions
The package contains the following functions:
1. `plot_mercedes_price`: Plot a density plot of a Mercedes-Benz model to see where the current vehicle's price falls for that same model in the market.
2. `listing_search`: Retrieves the top listings that are within the budget range specified by the user.
3. `listing_summary`: Summarize mileage, price, and rarity information in the dataset.
4. `predict_mercedes_price`: Predicts the price in USD of a Mercedes-Benz given the year, model, condition, and number of cylinders.
For a more detailed walkthrough of function usage, the package vignette is available [here](https://ubc-mds.github.io/mercedestrenzr/articles/mercedestrenzr-vignette.html)
# Package dataset
The package contains a static dataset for Craiglist used-car listings that were previously web scraped. Several key attributes about the used-car are available in the dataset, such as vehicle prices, models, car conditions, odometer readings, VINs, regions and transmission. The package's dataset was adapted from verison 10 of the raw dataset created by [AustinReese](https://github.com/AustinReese/UsedVehicleSearch).
# Installation
You can install the development version of mercedestrenzr from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("UBC-MDS/mercedestrenzr")
```
# Usage
This is a basic example which shows you how to solve a common problem:
```{r example}
library(mercedestrenzr)
# load sample data from package
summary(mercedes_data)
```
#### Overview of listings
```{r }
summary_result<- listing_summary(data = mercedes_data, model="all")
head(summary_result)
```
#### filter listings based on budget range of characteristics of interest
```{r }
result <- listing_search(mercedes_data, budget=c(0, 30000),
model = "any", sort_feature = "odometer_mi",
ascending = TRUE)
head(result[, 1:5], 5)
```
#### visualizing the price distribution
```{r plot_readme}
plot_mercedes_price('c-class', 30000, mercedes_data)
```
#### Prediction: how much a car would be using regression model
```{r }
price <- predict_mercedes_price("e-class", 2015, 55000, "fair", "silver")
price
```
## Code of Conduct
Please note that the mercedestrenzr project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
## Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.