# NOT RUN {
#This is a 4x2 brick. One level high, 2 x-values (columns), 4 y-values (rows).
brick <- data.frame(
Level="A",
X1 = rep(3,4), #The number 3 is the brickrID for 'bright red'
X2 = rep(3,4)
)
brick %>%
bricks_from_table() %>%
build_bricks()
rgl::clear3d()
#Build on top of each other by changing the Level value.
#This example builds a blue 2x2 brick on top of a red 2x2
brick <- data.frame(
Level=c("A", "A", "B", "B"),
X1 = c(3, 3, 4, 4), #3 is red, 4 is blue
X2 = c(3, 3, 4, 4)
)
brick %>%
bricks_from_table() %>%
build_bricks()
rgl::clear3d()
#Provide an additional piece_matrix argument to change the default brick shape.
pieces <- data.frame(
Level=c("A", "A", "B", "B"),
X1 = c("b", "b", "p", "p"), #b is brick (default), p is plate
X2 = c("b", "b", "p", "p")
)
# }
# NOT RUN {
brick %>%
bricks_from_table(piece_matrix=pieces) %>%
build_bricks()
rgl::clear3d()
# }
# NOT RUN {
#Provide a custom table of colors
custom_colors <- data.frame(
.value = c(3, 4),
Color = c("Bright orange", "Dark green")
)
# }
# NOT RUN {
brick %>%
bricks_from_table(color_guide = custom_colors) %>%
build_bricks()
rgl::clear3d()
# }
# NOT RUN {
#Limit the size of bricks used in the model with use_bricks
# }
# NOT RUN {
brick %>%
bricks_from_table(use_bricks = "2x1") %>% #Only use 2x1 bricks.
build_bricks()
rgl::clear3d()
# }
Run the code above in your browser using DataLab