2.7 Helper objects for plotting
Build lists of named point types vectors for easiness of reference.
Create point type vectors for the whole dataset:
labels_code <- as.character(row.names(cleanAmphorae)) # using row names
labels_cross <- rep("+", nrow(cleanAmphorae)) # using +
labels_x <- rep(4, nrow(cleanAmphorae)) # using pch code
labels_point <- rep(20, nrow(cleanAmphorae)) # using pch code
Create a list aiming to define workshops productions:
labels_list <- list(
Code = labels_code[!isShipwreck],
Cross = labels_cross[!isShipwreck],
X = labels_x[!isShipwreck],
Point = labels_point[!isShipwreck]
)
Create a list aiming to assign shipwreck observations to workshop productions:
labels_list_Shipwreck <- list(
Code = labels_code[!isTrueIND],
Cross = labels_cross[!isTrueIND],
X = labels_x[!isTrueIND],
Point = labels_point[!isTrueIND]
)
Build two other lists containing named group color vectors, picking different colors within the rainbow palette:
color_list <- list()
for (i in 1:length(factor_list)){
cv <- rainbow(nlevels(factor_list[[i]]), v=.8)
color_list[[i]] <- cv
names(color_list)[i] = names(factor_list)[i]
}
color_list_Shipwreck <- list()
for (i in 1:length(factor_list_Shipwreck)){
cv <- rainbow(nlevels(factor_list_Shipwreck[[i]]), v=.8)
color_list_Shipwreck[[i]] <- cv
names(color_list_Shipwreck)[i] = names(factor_list_Shipwreck)[i]
}
To visualize the colors:
par(mar = c(0,0,0,0))
barplot(rep(100, nlevels(factor_list$ProvGroup)),
col = color_list$ProvGroup,
axes = FALSE)