library(tidyverse) #includes {purrr}
library(jsonlite)
<- read_json("lego_sets.json")
lego_sets length(lego_sets)
[1] 100
Having a
p u r r r-tastic
time
β{purrr} enhances Rβs functional programming (FP) toolkit by providing a complete and consistent set of tools for working with functions and vectors.β
π π π π π π π π
library(tidyverse) #includes {purrr}
library(jsonlite)
lego_sets <- read_json("lego_sets.json")
length(lego_sets)
[1] 100
List of 5
$ name :List of 1
..$ : chr "Gears"
$ year :List of 1
..$ : int 1965
$ theme_id :List of 1
..$ : int 1
$ num_parts:List of 1
..$ : int 43
$ parts :List of 1
..$ :List of 12
.. ..$ Tyre Smooth Old Style - Small :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 29
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Rubber"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "Light Gray"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "9BA19D"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Plate 2 x 4 :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 14
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Plastic"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "White"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "FFFFFF"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Brick Round 1 x 1 Solid Stud, No Bottom Groove :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 20
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Plastic"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "White"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "FFFFFF"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Turntable 4 x 4 - Old Type Complete, Perfectly Round :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 18
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Plastic"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "White"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "FFFFFF"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Tyre Smooth Old Style - Large :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 29
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Rubber"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "Light Gray"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "9BA19D"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Wheel Old with 4 Studs :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 29
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Plastic"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "Red"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "C91A09"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside:List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 29
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Plastic"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "White"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "FFFFFF"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Wheel Old with 12 Studs :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 29
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Plastic"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "Red"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "C91A09"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Gear Samsonite 14 Tooth :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 52
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Plastic"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "White"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "FFFFFF"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Gear Samsonite 21 Tooth :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 52
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Plastic"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "Yellow"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "F2CD37"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Gear Samsonite 35 Tooth :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 52
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Plastic"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "Blue"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "0055BF"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
.. ..$ Gear Samsonite 42 Tooth :List of 5
.. .. ..$ part_cat_id :List of 1
.. .. .. ..$ : int 52
.. .. ..$ part_material:List of 1
.. .. .. ..$ : chr "Plastic"
.. .. ..$ color_name :List of 1
.. .. .. ..$ : chr "Red"
.. .. ..$ rgb :List of 1
.. .. .. ..$ : chr "C91A09"
.. .. ..$ is_trans :List of 1
.. .. .. ..$ : logi FALSE
R 4.1.0 introduces a new pipe |>
it is similar to %>%
from {magrittr} package
is (almost) equivalent to
R 4.1.0 also introduced a new shorthand for functions
is equivalent to
purrr supported function interface
maps
map()
functionsβThe map functions transform their input by applying a function to each element of a list or atomic vector and returning an object of the same length as the input.β
map(<vector>, <function>)
[[1]]
[1] 0.114
[[2]]
[1] 0.622 0.609
[[3]]
[1] 0.623 0.861 0.640
[[4]]
[1] 0.009 0.233 0.666 0.514
map(<vector>, <function>)
$mpg
[1] 10.4
$cyl
[1] 4
$disp
[1] 75.7
$hp
[1] 62
$drat
[1] 2.76
$wt
[1] 1.615
$qsec
[1] 14.6
$vs
[1] 0
$am
[1] 0
$gear
[1] 3
$carb
[1] 1
map(<vector>, <function>, <arguments>)
Using a map()
is very close similar to using a for
-loop and lapply()
These two statements are almost identical
map()
returns a list
map_lgl()
map_int()
map_dbl()
map_chr()
map_vec()
walk
Extracting all the names
[1] "Gears"
[2] "Space Mini-Figures"
[3] "Space Mini-Figures"
[4] "Space Mini-Figures"
[5] "Space Mini-Figures"
[6] "Castle Mini Figures"
[7] "4.5V Samsonite Gears Motor Set"
[8] "Legend of Chima: Corbeaux et Gorilles"
[9] "Master Mechanic Set"
[10] "Basic Building Set in Cardboard"
[11] "Basic Building Set in Cardboard"
[12] "Basic Building Set"
[13] "Basic Building Set"
[14] "Wheel Set"
[15] "Basic Building Set"
[16] "Ninjago: Build Your Own Adventure"
[17] "Star Wars: Build Your Own Adventure: Galactic Missions"
[18] "Nursery Furniture"
[19] "Building Set"
[20] "The Race to Build It Board Game"
[21] "Living Room"
[22] "Farm Animals"
[23] "Basic Building Set"
[24] "Pre-School Beginners Set"
[25] "Playhouse"
[26] "Jumbo Brick Pull Toy"
[27] "Basic Building Set"
[28] "Jumbo Bricks"
[29] "Farm"
[30] "Assorted Clear Bricks & Plates"
[31] "Lighting Device Pack"
[32] "Assorted Basic Bricks - Red"
[33] "Assorted Basic Bricks - White"
[34] "Assorted Basic Bricks - Blue"
[35] "Assorted Basic Bricks - Yellow"
[36] "Trees & Bushes"
[37] "Basic Building Set"
[38] "Large Wheels"
[39] "Small Wheels"
[40] "Assorted White Plates"
[41] "Jumbo Brick School Set"
[42] "Five Large Base Plates - Green"
[43] "Five Large Base Plates - White"
[44] "Five Large Base Plates - Blue"
[45] "Ducks"
[46] "Two Garage Door Kits"
[47] "Basic Building Set"
[48] "Block Box"
[49] "Pre-School Set"
[50] "Pre-School Set"
[51] "Atlantis: Brickmaster"
[52] "Pirates: Brickmaster"
[53] "Ninjago: Brickmaster"
[54] "Pre-School Set"
[55] "Roadway Base Plate"
[56] "Basic Building Set with Train"
[57] "Police Station"
[58] "Legoville"
[59] "Tub Boat"
[60] "Super Set"
[61] "Guarded Inn"
[62] "Mosaic Set"
[63] "Metroliner"
[64] "Railroad Club Car"
[65] "1 x 2 Sand Red Bricks"
[66] "2 x 2 Sand Red Bricks"
[67] "2 x 4 Sand Red Bricks"
[68] "1 x 6 Sand Red Bricks"
[69] "2 x 4 Sand Red Ridge Roof Tiles Steep Slope"
[70] "2 x 4 Roof Tile Sand Red"
[71] "Assorted Blue Bricks"
[72] "4.5V Motor with Wheels (Small Version)"
[73] "Assorted Yellow Bricks"
[74] "Assorted Blue Plates"
[75] "Assorted Yellow Plates"
[76] "Open Freight Wagon"
[77] "Caboose"
[78] "Passenger Wagon"
[79] "Tanker"
[80] "Hopper Wagon"
[81] "Darth Maul"
[82] "Rebel Blockade Runner"
[83] "4.5V Motor with Wheels (Large Version)"
[84] "Santa Fe Super Chief"
[85] "Santa Fe Super Chief - Limited Edition"
[86] "U.S.S. Constellation"
[87] "Santa Fe Cars - Set II (dining, observation, or sleeping car)"
[88] "Master Builder Set"
[89] "Red Baron"
[90] "Santa Fe Cars - Set I (mail or baggage car)"
[91] "Naboo Starfighter"
[92] "Train Engine Shed"
[93] "Lunar Lander"
[94] "Imperial Star Destroyer"
[95] "Pizza To Go"
[96] "Breezeway Cafe"
[97] "Black Falcon's Fortress"
[98] "Black Seas Barracuda"
[99] "Main Street"
[100] "American Flag"
Finding the number of parts
$name
$name[[1]]
[1] "Gears"
$year
$year[[1]]
[1] 1965
$theme_id
$theme_id[[1]]
[1] 1
$num_parts
$num_parts[[1]]
[1] 43
$parts
$parts[[1]]
$parts[[1]]$`Tyre Smooth Old Style - Small`
$parts[[1]]$`Tyre Smooth Old Style - Small`$part_cat_id
$parts[[1]]$`Tyre Smooth Old Style - Small`$part_cat_id[[1]]
[1] 29
$parts[[1]]$`Tyre Smooth Old Style - Small`$part_material
$parts[[1]]$`Tyre Smooth Old Style - Small`$part_material[[1]]
[1] "Rubber"
$parts[[1]]$`Tyre Smooth Old Style - Small`$color_name
$parts[[1]]$`Tyre Smooth Old Style - Small`$color_name[[1]]
[1] "Light Gray"
$parts[[1]]$`Tyre Smooth Old Style - Small`$rgb
$parts[[1]]$`Tyre Smooth Old Style - Small`$rgb[[1]]
[1] "9BA19D"
$parts[[1]]$`Tyre Smooth Old Style - Small`$is_trans
$parts[[1]]$`Tyre Smooth Old Style - Small`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Plate 2 x 4`
$parts[[1]]$`Plate 2 x 4`$part_cat_id
$parts[[1]]$`Plate 2 x 4`$part_cat_id[[1]]
[1] 14
$parts[[1]]$`Plate 2 x 4`$part_material
$parts[[1]]$`Plate 2 x 4`$part_material[[1]]
[1] "Plastic"
$parts[[1]]$`Plate 2 x 4`$color_name
$parts[[1]]$`Plate 2 x 4`$color_name[[1]]
[1] "White"
$parts[[1]]$`Plate 2 x 4`$rgb
$parts[[1]]$`Plate 2 x 4`$rgb[[1]]
[1] "FFFFFF"
$parts[[1]]$`Plate 2 x 4`$is_trans
$parts[[1]]$`Plate 2 x 4`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_cat_id
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_cat_id[[1]]
[1] 20
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_material
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_material[[1]]
[1] "Plastic"
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$color_name
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$color_name[[1]]
[1] "White"
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$rgb
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$rgb[[1]]
[1] "FFFFFF"
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$is_trans
$parts[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_cat_id
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_cat_id[[1]]
[1] 18
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_material
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_material[[1]]
[1] "Plastic"
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$color_name
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$color_name[[1]]
[1] "White"
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$rgb
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$rgb[[1]]
[1] "FFFFFF"
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$is_trans
$parts[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Tyre Smooth Old Style - Large`
$parts[[1]]$`Tyre Smooth Old Style - Large`$part_cat_id
$parts[[1]]$`Tyre Smooth Old Style - Large`$part_cat_id[[1]]
[1] 29
$parts[[1]]$`Tyre Smooth Old Style - Large`$part_material
$parts[[1]]$`Tyre Smooth Old Style - Large`$part_material[[1]]
[1] "Rubber"
$parts[[1]]$`Tyre Smooth Old Style - Large`$color_name
$parts[[1]]$`Tyre Smooth Old Style - Large`$color_name[[1]]
[1] "Light Gray"
$parts[[1]]$`Tyre Smooth Old Style - Large`$rgb
$parts[[1]]$`Tyre Smooth Old Style - Large`$rgb[[1]]
[1] "9BA19D"
$parts[[1]]$`Tyre Smooth Old Style - Large`$is_trans
$parts[[1]]$`Tyre Smooth Old Style - Large`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Wheel Old with 4 Studs`
$parts[[1]]$`Wheel Old with 4 Studs`$part_cat_id
$parts[[1]]$`Wheel Old with 4 Studs`$part_cat_id[[1]]
[1] 29
$parts[[1]]$`Wheel Old with 4 Studs`$part_material
$parts[[1]]$`Wheel Old with 4 Studs`$part_material[[1]]
[1] "Plastic"
$parts[[1]]$`Wheel Old with 4 Studs`$color_name
$parts[[1]]$`Wheel Old with 4 Studs`$color_name[[1]]
[1] "Red"
$parts[[1]]$`Wheel Old with 4 Studs`$rgb
$parts[[1]]$`Wheel Old with 4 Studs`$rgb[[1]]
[1] "C91A09"
$parts[[1]]$`Wheel Old with 4 Studs`$is_trans
$parts[[1]]$`Wheel Old with 4 Studs`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_cat_id
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_cat_id[[1]]
[1] 29
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_material
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_material[[1]]
[1] "Plastic"
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$color_name
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$color_name[[1]]
[1] "White"
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$rgb
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$rgb[[1]]
[1] "FFFFFF"
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$is_trans
$parts[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Wheel Old with 12 Studs`
$parts[[1]]$`Wheel Old with 12 Studs`$part_cat_id
$parts[[1]]$`Wheel Old with 12 Studs`$part_cat_id[[1]]
[1] 29
$parts[[1]]$`Wheel Old with 12 Studs`$part_material
$parts[[1]]$`Wheel Old with 12 Studs`$part_material[[1]]
[1] "Plastic"
$parts[[1]]$`Wheel Old with 12 Studs`$color_name
$parts[[1]]$`Wheel Old with 12 Studs`$color_name[[1]]
[1] "Red"
$parts[[1]]$`Wheel Old with 12 Studs`$rgb
$parts[[1]]$`Wheel Old with 12 Studs`$rgb[[1]]
[1] "C91A09"
$parts[[1]]$`Wheel Old with 12 Studs`$is_trans
$parts[[1]]$`Wheel Old with 12 Studs`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Gear Samsonite 14 Tooth`
$parts[[1]]$`Gear Samsonite 14 Tooth`$part_cat_id
$parts[[1]]$`Gear Samsonite 14 Tooth`$part_cat_id[[1]]
[1] 52
$parts[[1]]$`Gear Samsonite 14 Tooth`$part_material
$parts[[1]]$`Gear Samsonite 14 Tooth`$part_material[[1]]
[1] "Plastic"
$parts[[1]]$`Gear Samsonite 14 Tooth`$color_name
$parts[[1]]$`Gear Samsonite 14 Tooth`$color_name[[1]]
[1] "White"
$parts[[1]]$`Gear Samsonite 14 Tooth`$rgb
$parts[[1]]$`Gear Samsonite 14 Tooth`$rgb[[1]]
[1] "FFFFFF"
$parts[[1]]$`Gear Samsonite 14 Tooth`$is_trans
$parts[[1]]$`Gear Samsonite 14 Tooth`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Gear Samsonite 21 Tooth`
$parts[[1]]$`Gear Samsonite 21 Tooth`$part_cat_id
$parts[[1]]$`Gear Samsonite 21 Tooth`$part_cat_id[[1]]
[1] 52
$parts[[1]]$`Gear Samsonite 21 Tooth`$part_material
$parts[[1]]$`Gear Samsonite 21 Tooth`$part_material[[1]]
[1] "Plastic"
$parts[[1]]$`Gear Samsonite 21 Tooth`$color_name
$parts[[1]]$`Gear Samsonite 21 Tooth`$color_name[[1]]
[1] "Yellow"
$parts[[1]]$`Gear Samsonite 21 Tooth`$rgb
$parts[[1]]$`Gear Samsonite 21 Tooth`$rgb[[1]]
[1] "F2CD37"
$parts[[1]]$`Gear Samsonite 21 Tooth`$is_trans
$parts[[1]]$`Gear Samsonite 21 Tooth`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Gear Samsonite 35 Tooth`
$parts[[1]]$`Gear Samsonite 35 Tooth`$part_cat_id
$parts[[1]]$`Gear Samsonite 35 Tooth`$part_cat_id[[1]]
[1] 52
$parts[[1]]$`Gear Samsonite 35 Tooth`$part_material
$parts[[1]]$`Gear Samsonite 35 Tooth`$part_material[[1]]
[1] "Plastic"
$parts[[1]]$`Gear Samsonite 35 Tooth`$color_name
$parts[[1]]$`Gear Samsonite 35 Tooth`$color_name[[1]]
[1] "Blue"
$parts[[1]]$`Gear Samsonite 35 Tooth`$rgb
$parts[[1]]$`Gear Samsonite 35 Tooth`$rgb[[1]]
[1] "0055BF"
$parts[[1]]$`Gear Samsonite 35 Tooth`$is_trans
$parts[[1]]$`Gear Samsonite 35 Tooth`$is_trans[[1]]
[1] FALSE
$parts[[1]]$`Gear Samsonite 42 Tooth`
$parts[[1]]$`Gear Samsonite 42 Tooth`$part_cat_id
$parts[[1]]$`Gear Samsonite 42 Tooth`$part_cat_id[[1]]
[1] 52
$parts[[1]]$`Gear Samsonite 42 Tooth`$part_material
$parts[[1]]$`Gear Samsonite 42 Tooth`$part_material[[1]]
[1] "Plastic"
$parts[[1]]$`Gear Samsonite 42 Tooth`$color_name
$parts[[1]]$`Gear Samsonite 42 Tooth`$color_name[[1]]
[1] "Red"
$parts[[1]]$`Gear Samsonite 42 Tooth`$rgb
$parts[[1]]$`Gear Samsonite 42 Tooth`$rgb[[1]]
[1] "C91A09"
$parts[[1]]$`Gear Samsonite 42 Tooth`$is_trans
$parts[[1]]$`Gear Samsonite 42 Tooth`$is_trans[[1]]
[1] FALSE
Finding the number of parts
[[1]]
[[1]]$`Tyre Smooth Old Style - Small`
[[1]]$`Tyre Smooth Old Style - Small`$part_cat_id
[[1]]$`Tyre Smooth Old Style - Small`$part_cat_id[[1]]
[1] 29
[[1]]$`Tyre Smooth Old Style - Small`$part_material
[[1]]$`Tyre Smooth Old Style - Small`$part_material[[1]]
[1] "Rubber"
[[1]]$`Tyre Smooth Old Style - Small`$color_name
[[1]]$`Tyre Smooth Old Style - Small`$color_name[[1]]
[1] "Light Gray"
[[1]]$`Tyre Smooth Old Style - Small`$rgb
[[1]]$`Tyre Smooth Old Style - Small`$rgb[[1]]
[1] "9BA19D"
[[1]]$`Tyre Smooth Old Style - Small`$is_trans
[[1]]$`Tyre Smooth Old Style - Small`$is_trans[[1]]
[1] FALSE
[[1]]$`Plate 2 x 4`
[[1]]$`Plate 2 x 4`$part_cat_id
[[1]]$`Plate 2 x 4`$part_cat_id[[1]]
[1] 14
[[1]]$`Plate 2 x 4`$part_material
[[1]]$`Plate 2 x 4`$part_material[[1]]
[1] "Plastic"
[[1]]$`Plate 2 x 4`$color_name
[[1]]$`Plate 2 x 4`$color_name[[1]]
[1] "White"
[[1]]$`Plate 2 x 4`$rgb
[[1]]$`Plate 2 x 4`$rgb[[1]]
[1] "FFFFFF"
[[1]]$`Plate 2 x 4`$is_trans
[[1]]$`Plate 2 x 4`$is_trans[[1]]
[1] FALSE
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_cat_id
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_cat_id[[1]]
[1] 20
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_material
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_material[[1]]
[1] "Plastic"
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$color_name
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$color_name[[1]]
[1] "White"
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$rgb
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$rgb[[1]]
[1] "FFFFFF"
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$is_trans
[[1]]$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$is_trans[[1]]
[1] FALSE
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_cat_id
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_cat_id[[1]]
[1] 18
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_material
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_material[[1]]
[1] "Plastic"
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$color_name
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$color_name[[1]]
[1] "White"
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$rgb
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$rgb[[1]]
[1] "FFFFFF"
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$is_trans
[[1]]$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$is_trans[[1]]
[1] FALSE
[[1]]$`Tyre Smooth Old Style - Large`
[[1]]$`Tyre Smooth Old Style - Large`$part_cat_id
[[1]]$`Tyre Smooth Old Style - Large`$part_cat_id[[1]]
[1] 29
[[1]]$`Tyre Smooth Old Style - Large`$part_material
[[1]]$`Tyre Smooth Old Style - Large`$part_material[[1]]
[1] "Rubber"
[[1]]$`Tyre Smooth Old Style - Large`$color_name
[[1]]$`Tyre Smooth Old Style - Large`$color_name[[1]]
[1] "Light Gray"
[[1]]$`Tyre Smooth Old Style - Large`$rgb
[[1]]$`Tyre Smooth Old Style - Large`$rgb[[1]]
[1] "9BA19D"
[[1]]$`Tyre Smooth Old Style - Large`$is_trans
[[1]]$`Tyre Smooth Old Style - Large`$is_trans[[1]]
[1] FALSE
[[1]]$`Wheel Old with 4 Studs`
[[1]]$`Wheel Old with 4 Studs`$part_cat_id
[[1]]$`Wheel Old with 4 Studs`$part_cat_id[[1]]
[1] 29
[[1]]$`Wheel Old with 4 Studs`$part_material
[[1]]$`Wheel Old with 4 Studs`$part_material[[1]]
[1] "Plastic"
[[1]]$`Wheel Old with 4 Studs`$color_name
[[1]]$`Wheel Old with 4 Studs`$color_name[[1]]
[1] "Red"
[[1]]$`Wheel Old with 4 Studs`$rgb
[[1]]$`Wheel Old with 4 Studs`$rgb[[1]]
[1] "C91A09"
[[1]]$`Wheel Old with 4 Studs`$is_trans
[[1]]$`Wheel Old with 4 Studs`$is_trans[[1]]
[1] FALSE
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_cat_id
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_cat_id[[1]]
[1] 29
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_material
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_material[[1]]
[1] "Plastic"
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$color_name
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$color_name[[1]]
[1] "White"
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$rgb
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$rgb[[1]]
[1] "FFFFFF"
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$is_trans
[[1]]$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$is_trans[[1]]
[1] FALSE
[[1]]$`Wheel Old with 12 Studs`
[[1]]$`Wheel Old with 12 Studs`$part_cat_id
[[1]]$`Wheel Old with 12 Studs`$part_cat_id[[1]]
[1] 29
[[1]]$`Wheel Old with 12 Studs`$part_material
[[1]]$`Wheel Old with 12 Studs`$part_material[[1]]
[1] "Plastic"
[[1]]$`Wheel Old with 12 Studs`$color_name
[[1]]$`Wheel Old with 12 Studs`$color_name[[1]]
[1] "Red"
[[1]]$`Wheel Old with 12 Studs`$rgb
[[1]]$`Wheel Old with 12 Studs`$rgb[[1]]
[1] "C91A09"
[[1]]$`Wheel Old with 12 Studs`$is_trans
[[1]]$`Wheel Old with 12 Studs`$is_trans[[1]]
[1] FALSE
[[1]]$`Gear Samsonite 14 Tooth`
[[1]]$`Gear Samsonite 14 Tooth`$part_cat_id
[[1]]$`Gear Samsonite 14 Tooth`$part_cat_id[[1]]
[1] 52
[[1]]$`Gear Samsonite 14 Tooth`$part_material
[[1]]$`Gear Samsonite 14 Tooth`$part_material[[1]]
[1] "Plastic"
[[1]]$`Gear Samsonite 14 Tooth`$color_name
[[1]]$`Gear Samsonite 14 Tooth`$color_name[[1]]
[1] "White"
[[1]]$`Gear Samsonite 14 Tooth`$rgb
[[1]]$`Gear Samsonite 14 Tooth`$rgb[[1]]
[1] "FFFFFF"
[[1]]$`Gear Samsonite 14 Tooth`$is_trans
[[1]]$`Gear Samsonite 14 Tooth`$is_trans[[1]]
[1] FALSE
[[1]]$`Gear Samsonite 21 Tooth`
[[1]]$`Gear Samsonite 21 Tooth`$part_cat_id
[[1]]$`Gear Samsonite 21 Tooth`$part_cat_id[[1]]
[1] 52
[[1]]$`Gear Samsonite 21 Tooth`$part_material
[[1]]$`Gear Samsonite 21 Tooth`$part_material[[1]]
[1] "Plastic"
[[1]]$`Gear Samsonite 21 Tooth`$color_name
[[1]]$`Gear Samsonite 21 Tooth`$color_name[[1]]
[1] "Yellow"
[[1]]$`Gear Samsonite 21 Tooth`$rgb
[[1]]$`Gear Samsonite 21 Tooth`$rgb[[1]]
[1] "F2CD37"
[[1]]$`Gear Samsonite 21 Tooth`$is_trans
[[1]]$`Gear Samsonite 21 Tooth`$is_trans[[1]]
[1] FALSE
[[1]]$`Gear Samsonite 35 Tooth`
[[1]]$`Gear Samsonite 35 Tooth`$part_cat_id
[[1]]$`Gear Samsonite 35 Tooth`$part_cat_id[[1]]
[1] 52
[[1]]$`Gear Samsonite 35 Tooth`$part_material
[[1]]$`Gear Samsonite 35 Tooth`$part_material[[1]]
[1] "Plastic"
[[1]]$`Gear Samsonite 35 Tooth`$color_name
[[1]]$`Gear Samsonite 35 Tooth`$color_name[[1]]
[1] "Blue"
[[1]]$`Gear Samsonite 35 Tooth`$rgb
[[1]]$`Gear Samsonite 35 Tooth`$rgb[[1]]
[1] "0055BF"
[[1]]$`Gear Samsonite 35 Tooth`$is_trans
[[1]]$`Gear Samsonite 35 Tooth`$is_trans[[1]]
[1] FALSE
[[1]]$`Gear Samsonite 42 Tooth`
[[1]]$`Gear Samsonite 42 Tooth`$part_cat_id
[[1]]$`Gear Samsonite 42 Tooth`$part_cat_id[[1]]
[1] 52
[[1]]$`Gear Samsonite 42 Tooth`$part_material
[[1]]$`Gear Samsonite 42 Tooth`$part_material[[1]]
[1] "Plastic"
[[1]]$`Gear Samsonite 42 Tooth`$color_name
[[1]]$`Gear Samsonite 42 Tooth`$color_name[[1]]
[1] "Red"
[[1]]$`Gear Samsonite 42 Tooth`$rgb
[[1]]$`Gear Samsonite 42 Tooth`$rgb[[1]]
[1] "C91A09"
[[1]]$`Gear Samsonite 42 Tooth`$is_trans
[[1]]$`Gear Samsonite 42 Tooth`$is_trans[[1]]
[1] FALSE
Finding the number of parts
$`Tyre Smooth Old Style - Small`
$`Tyre Smooth Old Style - Small`$part_cat_id
$`Tyre Smooth Old Style - Small`$part_cat_id[[1]]
[1] 29
$`Tyre Smooth Old Style - Small`$part_material
$`Tyre Smooth Old Style - Small`$part_material[[1]]
[1] "Rubber"
$`Tyre Smooth Old Style - Small`$color_name
$`Tyre Smooth Old Style - Small`$color_name[[1]]
[1] "Light Gray"
$`Tyre Smooth Old Style - Small`$rgb
$`Tyre Smooth Old Style - Small`$rgb[[1]]
[1] "9BA19D"
$`Tyre Smooth Old Style - Small`$is_trans
$`Tyre Smooth Old Style - Small`$is_trans[[1]]
[1] FALSE
$`Plate 2 x 4`
$`Plate 2 x 4`$part_cat_id
$`Plate 2 x 4`$part_cat_id[[1]]
[1] 14
$`Plate 2 x 4`$part_material
$`Plate 2 x 4`$part_material[[1]]
[1] "Plastic"
$`Plate 2 x 4`$color_name
$`Plate 2 x 4`$color_name[[1]]
[1] "White"
$`Plate 2 x 4`$rgb
$`Plate 2 x 4`$rgb[[1]]
[1] "FFFFFF"
$`Plate 2 x 4`$is_trans
$`Plate 2 x 4`$is_trans[[1]]
[1] FALSE
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_cat_id
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_cat_id[[1]]
[1] 20
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_material
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$part_material[[1]]
[1] "Plastic"
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$color_name
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$color_name[[1]]
[1] "White"
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$rgb
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$rgb[[1]]
[1] "FFFFFF"
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$is_trans
$`Brick Round 1 x 1 Solid Stud, No Bottom Groove`$is_trans[[1]]
[1] FALSE
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_cat_id
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_cat_id[[1]]
[1] 18
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_material
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$part_material[[1]]
[1] "Plastic"
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$color_name
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$color_name[[1]]
[1] "White"
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$rgb
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$rgb[[1]]
[1] "FFFFFF"
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$is_trans
$`Turntable 4 x 4 - Old Type Complete, Perfectly Round`$is_trans[[1]]
[1] FALSE
$`Tyre Smooth Old Style - Large`
$`Tyre Smooth Old Style - Large`$part_cat_id
$`Tyre Smooth Old Style - Large`$part_cat_id[[1]]
[1] 29
$`Tyre Smooth Old Style - Large`$part_material
$`Tyre Smooth Old Style - Large`$part_material[[1]]
[1] "Rubber"
$`Tyre Smooth Old Style - Large`$color_name
$`Tyre Smooth Old Style - Large`$color_name[[1]]
[1] "Light Gray"
$`Tyre Smooth Old Style - Large`$rgb
$`Tyre Smooth Old Style - Large`$rgb[[1]]
[1] "9BA19D"
$`Tyre Smooth Old Style - Large`$is_trans
$`Tyre Smooth Old Style - Large`$is_trans[[1]]
[1] FALSE
$`Wheel Old with 4 Studs`
$`Wheel Old with 4 Studs`$part_cat_id
$`Wheel Old with 4 Studs`$part_cat_id[[1]]
[1] 29
$`Wheel Old with 4 Studs`$part_material
$`Wheel Old with 4 Studs`$part_material[[1]]
[1] "Plastic"
$`Wheel Old with 4 Studs`$color_name
$`Wheel Old with 4 Studs`$color_name[[1]]
[1] "Red"
$`Wheel Old with 4 Studs`$rgb
$`Wheel Old with 4 Studs`$rgb[[1]]
[1] "C91A09"
$`Wheel Old with 4 Studs`$is_trans
$`Wheel Old with 4 Studs`$is_trans[[1]]
[1] FALSE
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_cat_id
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_cat_id[[1]]
[1] 29
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_material
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$part_material[[1]]
[1] "Plastic"
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$color_name
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$color_name[[1]]
[1] "White"
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$rgb
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$rgb[[1]]
[1] "FFFFFF"
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$is_trans
$`Brick Special 2 x 4 with Red Wheels Holder Old, Clear Bottom, Red Inside`$is_trans[[1]]
[1] FALSE
$`Wheel Old with 12 Studs`
$`Wheel Old with 12 Studs`$part_cat_id
$`Wheel Old with 12 Studs`$part_cat_id[[1]]
[1] 29
$`Wheel Old with 12 Studs`$part_material
$`Wheel Old with 12 Studs`$part_material[[1]]
[1] "Plastic"
$`Wheel Old with 12 Studs`$color_name
$`Wheel Old with 12 Studs`$color_name[[1]]
[1] "Red"
$`Wheel Old with 12 Studs`$rgb
$`Wheel Old with 12 Studs`$rgb[[1]]
[1] "C91A09"
$`Wheel Old with 12 Studs`$is_trans
$`Wheel Old with 12 Studs`$is_trans[[1]]
[1] FALSE
$`Gear Samsonite 14 Tooth`
$`Gear Samsonite 14 Tooth`$part_cat_id
$`Gear Samsonite 14 Tooth`$part_cat_id[[1]]
[1] 52
$`Gear Samsonite 14 Tooth`$part_material
$`Gear Samsonite 14 Tooth`$part_material[[1]]
[1] "Plastic"
$`Gear Samsonite 14 Tooth`$color_name
$`Gear Samsonite 14 Tooth`$color_name[[1]]
[1] "White"
$`Gear Samsonite 14 Tooth`$rgb
$`Gear Samsonite 14 Tooth`$rgb[[1]]
[1] "FFFFFF"
$`Gear Samsonite 14 Tooth`$is_trans
$`Gear Samsonite 14 Tooth`$is_trans[[1]]
[1] FALSE
$`Gear Samsonite 21 Tooth`
$`Gear Samsonite 21 Tooth`$part_cat_id
$`Gear Samsonite 21 Tooth`$part_cat_id[[1]]
[1] 52
$`Gear Samsonite 21 Tooth`$part_material
$`Gear Samsonite 21 Tooth`$part_material[[1]]
[1] "Plastic"
$`Gear Samsonite 21 Tooth`$color_name
$`Gear Samsonite 21 Tooth`$color_name[[1]]
[1] "Yellow"
$`Gear Samsonite 21 Tooth`$rgb
$`Gear Samsonite 21 Tooth`$rgb[[1]]
[1] "F2CD37"
$`Gear Samsonite 21 Tooth`$is_trans
$`Gear Samsonite 21 Tooth`$is_trans[[1]]
[1] FALSE
$`Gear Samsonite 35 Tooth`
$`Gear Samsonite 35 Tooth`$part_cat_id
$`Gear Samsonite 35 Tooth`$part_cat_id[[1]]
[1] 52
$`Gear Samsonite 35 Tooth`$part_material
$`Gear Samsonite 35 Tooth`$part_material[[1]]
[1] "Plastic"
$`Gear Samsonite 35 Tooth`$color_name
$`Gear Samsonite 35 Tooth`$color_name[[1]]
[1] "Blue"
$`Gear Samsonite 35 Tooth`$rgb
$`Gear Samsonite 35 Tooth`$rgb[[1]]
[1] "0055BF"
$`Gear Samsonite 35 Tooth`$is_trans
$`Gear Samsonite 35 Tooth`$is_trans[[1]]
[1] FALSE
$`Gear Samsonite 42 Tooth`
$`Gear Samsonite 42 Tooth`$part_cat_id
$`Gear Samsonite 42 Tooth`$part_cat_id[[1]]
[1] 52
$`Gear Samsonite 42 Tooth`$part_material
$`Gear Samsonite 42 Tooth`$part_material[[1]]
[1] "Plastic"
$`Gear Samsonite 42 Tooth`$color_name
$`Gear Samsonite 42 Tooth`$color_name[[1]]
[1] "Red"
$`Gear Samsonite 42 Tooth`$rgb
$`Gear Samsonite 42 Tooth`$rgb[[1]]
[1] "C91A09"
$`Gear Samsonite 42 Tooth`$is_trans
$`Gear Samsonite 42 Tooth`$is_trans[[1]]
[1] FALSE
Finding the number of parts
Finding the number of parts
001-1 0012-1 0013-1 0014-1 0015-1 0016-1
12 1 1 1 1 1
002-1 002253963-1 003-1 005-1 010-1 010-3
3 4 28 5 5 6
011-1 021-1 022-1 0241187567-1 0241357594-1 028-1
13 30 11 33 29 6
030-2 03093-1 032-1 033-1 033-2 041-1
3 34 8 13 17 1
041-2 042-1 044-1 044-2 045-1 045-2
1 2 22 1 27 9
050-2 051-1 052-1 053-1 054-1 055-1
4 7 7 7 7 3
055-2 057-1 058-1 060-1 060-3 061-1
23 7 6 5 1 1
062-1 063-1 063-2 065-1 066-1 071-1
1 1 5 3 29 2
074-1 075-1 0756668530-1 0756672805-1 0756682762-1 077-1
2 5 64 64 60 6
078-1 080-1 080-3 082-1 086-1 088-1
1 57 13 20 3 46
10000-1 1000-1 10001-1 10002-1 10003-1 10004-1
66 54 111 54 1 1
10005-1 10006-1 10007-1 10008-1 10009-1 100-1
1 1 1 1 11 10
10010-1 10011-1 10012-1 10013-1 10014-1 10015-1
11 17 17 26 47 35
10016-1 10017-1 10018-1 10019-1 100-2 10020-1
33 41 59 164 9 83
10020-2 10021-1 10022-1 10023-1 10024-1 10025-1
86 58 63 45 140 57
10026-1 10027-1 10029-1 10030-1 10036-1 10037-1
71 121 96 160 58 52
10039-1 10040-1 10041-1 10042-1
74 138 93 6
[1] "Gears"
[2] "Space Mini-Figures"
[3] "Space Mini-Figures"
[4] "Space Mini-Figures"
[5] "Space Mini-Figures"
[6] "Castle Mini Figures"
[7] "4.5V Samsonite Gears Motor Set"
[8] "Legend of Chima: Corbeaux et Gorilles"
[9] "Master Mechanic Set"
[10] "Basic Building Set in Cardboard"
[11] "Basic Building Set in Cardboard"
[12] "Basic Building Set"
[13] "Basic Building Set"
[14] "Wheel Set"
[15] "Basic Building Set"
[16] "Ninjago: Build Your Own Adventure"
[17] "Star Wars: Build Your Own Adventure: Galactic Missions"
[18] "Nursery Furniture"
[19] "Building Set"
[20] "The Race to Build It Board Game"
[21] "Living Room"
[22] "Farm Animals"
[23] "Basic Building Set"
[24] "Pre-School Beginners Set"
[25] "Playhouse"
[26] "Jumbo Brick Pull Toy"
[27] "Basic Building Set"
[28] "Jumbo Bricks"
[29] "Farm"
[30] "Assorted Clear Bricks & Plates"
[31] "Lighting Device Pack"
[32] "Assorted Basic Bricks - Red"
[33] "Assorted Basic Bricks - White"
[34] "Assorted Basic Bricks - Blue"
[35] "Assorted Basic Bricks - Yellow"
[36] "Trees & Bushes"
[37] "Basic Building Set"
[38] "Large Wheels"
[39] "Small Wheels"
[40] "Assorted White Plates"
[41] "Jumbo Brick School Set"
[42] "Five Large Base Plates - Green"
[43] "Five Large Base Plates - White"
[44] "Five Large Base Plates - Blue"
[45] "Ducks"
[46] "Two Garage Door Kits"
[47] "Basic Building Set"
[48] "Block Box"
[49] "Pre-School Set"
[50] "Pre-School Set"
[51] "Atlantis: Brickmaster"
[52] "Pirates: Brickmaster"
[53] "Ninjago: Brickmaster"
[54] "Pre-School Set"
[55] "Roadway Base Plate"
[56] "Basic Building Set with Train"
[57] "Police Station"
[58] "Legoville"
[59] "Tub Boat"
[60] "Super Set"
[61] "Guarded Inn"
[62] "Mosaic Set"
[63] "Metroliner"
[64] "Railroad Club Car"
[65] "1 x 2 Sand Red Bricks"
[66] "2 x 2 Sand Red Bricks"
[67] "2 x 4 Sand Red Bricks"
[68] "1 x 6 Sand Red Bricks"
[69] "2 x 4 Sand Red Ridge Roof Tiles Steep Slope"
[70] "2 x 4 Roof Tile Sand Red"
[71] "Assorted Blue Bricks"
[72] "4.5V Motor with Wheels (Small Version)"
[73] "Assorted Yellow Bricks"
[74] "Assorted Blue Plates"
[75] "Assorted Yellow Plates"
[76] "Open Freight Wagon"
[77] "Caboose"
[78] "Passenger Wagon"
[79] "Tanker"
[80] "Hopper Wagon"
[81] "Darth Maul"
[82] "Rebel Blockade Runner"
[83] "4.5V Motor with Wheels (Large Version)"
[84] "Santa Fe Super Chief"
[85] "Santa Fe Super Chief - Limited Edition"
[86] "U.S.S. Constellation"
[87] "Santa Fe Cars - Set II (dining, observation, or sleeping car)"
[88] "Master Builder Set"
[89] "Red Baron"
[90] "Santa Fe Cars - Set I (mail or baggage car)"
[91] "Naboo Starfighter"
[92] "Train Engine Shed"
[93] "Lunar Lander"
[94] "Imperial Star Destroyer"
[95] "Pizza To Go"
[96] "Breezeway Cafe"
[97] "Black Falcon's Fortress"
[98] "Black Seas Barracuda"
[99] "Main Street"
[100] "American Flag"
most_common <- function(x) names(tail(sort(table(x)), 1))
extract_info <- function(x) {
data.frame(
year = x$year[[1]],
color = map_chr(x$parts[[1]], \(x) x$color_name[[1]]) |> most_common(),
name = substr(x$name[[1]], 1, 50)
)
}
map(lego_sets, extract_info) |>
list_rbind()
year color name
1 1965 White Gears
2 1979 Black Space Mini-Figures
3 1979 Black Space Mini-Figures
4 1979 Black Space Mini-Figures
5 1979 Black Space Mini-Figures
6 1979 Light Gray Castle Mini Figures
7 1965 White 4.5V Samsonite Gears Motor Set
8 2013 Light Bluish Gray Legend of Chima: Corbeaux et Gorilles
9 1966 White Master Mechanic Set
10 1965 White Basic Building Set in Cardboard
11 1965 White Basic Building Set in Cardboard
12 1968 Red Basic Building Set
13 1968 Red Basic Building Set
14 1966 Red Wheel Set
15 1968 Red Basic Building Set
16 2015 Green Ninjago: Build Your Own Adventure
17 2019 Red Star Wars: Build Your Own Adventure: Galactic Miss
18 1979 Blue Nursery Furniture
19 1973 Blue Building Set
20 1999 Yellow The Race to Build It Board Game
21 1979 Red Living Room
22 1979 Yellow Farm Animals
23 1968 White Basic Building Set
24 1964 White Pre-School Beginners Set
25 1979 Red Playhouse
26 1966 White Jumbo Brick Pull Toy
27 1968 Red Basic Building Set
28 1969 Blue Jumbo Bricks
29 1979 Yellow Farm
30 1969 Trans-Clear Assorted Clear Bricks & Plates
31 1969 White Lighting Device Pack
32 1966 Red Assorted Basic Bricks - Red
33 1966 White Assorted Basic Bricks - White
34 1966 Blue Assorted Basic Bricks - Blue
35 1966 Yellow Assorted Basic Bricks - Yellow
36 1966 Green Trees & Bushes
37 1968 Red Basic Building Set
38 1966 White Large Wheels
39 1966 White Small Wheels
40 1966 White Assorted White Plates
41 1968 Blue Jumbo Brick School Set
42 1966 Green Five Large Base Plates - Green
43 1966 White Five Large Base Plates - White
44 1966 Blue Five Large Base Plates - Blue
45 1978 Yellow Ducks
46 1969 Light Gray Two Garage Door Kits
47 1968 Red Basic Building Set
48 1979 Red Block Box
49 1976 Yellow Pre-School Set
50 1975 Red Pre-School Set
51 2010 Black Atlantis: Brickmaster
52 2009 Reddish Brown Pirates: Brickmaster
53 2011 Black Ninjago: Brickmaster
54 1975 Yellow Pre-School Set
55 1970 Green Roadway Base Plate
56 1967 Red Basic Building Set with Train
57 1976 Yellow Police Station
58 1976 Red Legoville
59 1978 Yellow Tub Boat
60 1969 Red Super Set
61 2001 Light Gray Guarded Inn
62 1985 White Mosaic Set
63 2001 Black Metroliner
64 2001 Light Gray Railroad Club Car
65 2001 Sand Red 1 x 2 Sand Red Bricks
66 2001 Sand Red 2 x 2 Sand Red Bricks
67 2001 Sand Red 2 x 4 Sand Red Bricks
68 2001 Sand Red 1 x 6 Sand Red Bricks
69 2001 Sand Red 2 x 4 Sand Red Ridge Roof Tiles Steep Slope
70 2001 Sand Red 2 x 4 Roof Tile Sand Red
71 2001 Blue Assorted Blue Bricks
72 1966 Red 4.5V Motor with Wheels (Small Version)
73 2003 Yellow Assorted Yellow Bricks
74 2001 Blue Assorted Blue Plates
75 2001 Yellow Assorted Yellow Plates
76 2001 Black Open Freight Wagon
77 2001 Black Caboose
78 2001 Black Passenger Wagon
79 2001 Black Tanker
80 2001 Black Hopper Wagon
81 2001 Black Darth Maul
82 2001 White Rebel Blockade Runner
83 1966 Light Gray 4.5V Motor with Wheels (Large Version)
84 2002 Light Gray Santa Fe Super Chief
85 2002 Light Gray Santa Fe Super Chief - Limited Edition
86 2003 Black U.S.S. Constellation
87 2002 Light Gray Santa Fe Cars - Set II (dining, observation, or sl
88 2002 Dark Gray Master Builder Set
89 2002 Red Red Baron
90 2002 Light Gray Santa Fe Cars - Set I (mail or baggage car)
91 2002 Yellow Naboo Starfighter
92 2003 Dark Gray Train Engine Shed
93 2003 Light Gray Lunar Lander
94 2002 Light Gray Imperial Star Destroyer
95 2002 White Pizza To Go
96 2002 White Breezeway Cafe
97 2002 Light Gray Black Falcon's Fortress
98 2002 Black Black Seas Barracuda
99 2003 White Main Street
100 2003 White American Flag
map2(<vector>, <vector>, <function>)
[[1]]
[1] 5.061
[[2]]
[1] -5.173 -4.920
[[3]]
[1] -4.516 -7.120 -3.818
[[4]]
[1] -6.989 -5.434 0.451 6.716
[[5]]
[1] -0.662 -3.066 -5.467 -5.023 14.495
[[6]]
[1] 0.670 -2.453 -2.203 2.298 -3.469 -7.241
[[7]]
[1] 2.299 -4.095 -0.061 -3.744 4.409 -1.902 -2.838
[[8]]
[1] -1.504 -4.887 -3.503 -6.540 -4.023 -0.883 -1.398 4.348
[[9]]
[1] -2.137 -1.711 -0.561 -1.989 -1.937 -2.215 -2.504 -1.048 -0.994
[[10]]
[1] -1.806 -0.582 -1.109 -1.015 -0.162 0.563 1.648 -0.773 1.606 -1.158
pmap(<list of vectors>, <function>)
[[1]]
[1] 111
[[2]]
[1] 221
[[3]]
[1] 331
similar to select()
from {dplyr}, helps with going deep in list
Great at the end of long chain of pipes
possibly()
quietly()
safely()
slowly()
Having models that sometimes error are a living nightmare, using safely()
lets to run everything and diagnose later
Web scraping typically calls for delays between fetching, we handle this with slowly()
$mpg
[1] 20.09062
$cyl
[1] 6.1875
$disp
[1] 230.7219
$hp
[1] 146.6875
$drat
[1] 3.596563
$wt
[1] 3.21725
$qsec
[1] 17.84875
$vs
[1] 0.4375
$am
[1] 0.40625
$gear
[1] 3.6875
$carb
[1] 2.8125
library(slider)
# Moving average (Aligned right)
# "The current element + 2 elements before"
slide_dbl(1:5, mean, .before = 2)
[1] 1.0 1.5 2.0 3.0 4.0
#> [1] 1.0 1.5 2.0 3.0 4.0
# Align left
# "The current element + 2 elements after"
slide_dbl(1:5, mean, .after = 2)
[1] 2.0 3.0 4.0 4.5 5.0
#> [1] 2.0 3.0 4.0 4.5 5.0
# Center aligned
# "The current element + 1 element before + 1 element after"
slide_dbl(1:5, mean, .before = 1, .after = 1)
[1] 1.5 2.0 3.0 4.0 4.5
T H A N K
Y O U