Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seankross/lego
:smiley: R data package featuring every Lego set from 1970 to 2015
https://github.com/seankross/lego
lego r
Last synced: about 2 months ago
JSON representation
:smiley: R data package featuring every Lego set from 1970 to 2015
- Host: GitHub
- URL: https://github.com/seankross/lego
- Owner: seankross
- Created: 2014-08-21T05:46:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-11-28T09:39:50.000Z (about 1 year ago)
- Last Synced: 2024-08-02T05:13:03.213Z (5 months ago)
- Topics: lego, r
- Language: R
- Homepage:
- Size: 2.27 MB
- Stars: 136
- Watchers: 9
- Forks: 46
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lego
This R data package contains information about every Lego set manufactured from 1970 to 2015, a total of 6172 sets. A few of the variables included for each set are:
- Item number
- Name
- Year manufactured
- Theme
- Number of pieces
- Number of minifigures included
- Price## To install:
```r
library(devtools)
install_github("seankross/lego")
```## Play well:
```r
library(dplyr)avg_price_per_year <- legosets %>%
filter(!is.na(USD_MSRP)) %>%
group_by(Year) %>%
do(data.frame(Price = mean(.$USD_MSRP)))med_price_per_year <- legosets %>%
filter(!is.na(USD_MSRP)) %>%
group_by(Year) %>%
do(data.frame(Price = median(.$USD_MSRP)))plot(avg_price_per_year, type = "l", col = "blue",
main = "Lego set prices over time", ylim = c(0, max(avg_price_per_year$Price)))
points(med_price_per_year, type = "l", col = "red")
legend("topleft", inset=c(0.2,0), legend=c("Average","Median"), lty=c(1,1), col=c("blue", "red"))
```