| Student ID Number 132502 | |
| Student Name | Joy Jerono |
| BBIT 4.2 Group | B |
| BI Project Group Name/ID (if applicable) | … |
Note: the following KnitR options have been set as
the global defaults:
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, eval = TRUE, collapse = FALSE, tidy = TRUE).
More KnitR options are documented here https://bookdown.org/yihui/rmarkdown-cookbook/chunk-options.html and here https://yihui.org/knitr/options/.
library(readr) Carlifonia_Housing <- read_csv(“data/Carlifonia Housing.csv”) View(Carlifonia_Housing) .libPaths()
The dataset that was used can be downloaded here: <https://github.com/joykiptoo/BI-project/blob/main/Carlifonia_Housing.csv>
<Cite the dataset here using APA>
Refer to the APA 7th edition manual for rules on how to cite datasets:
https://apastyle.apa.org/style-grammar-guidelines/references/examples/data-set-references
if (!is.element("mlbench", installed.packages()[, 1])) {
install.packages("mlbench", dependencies = TRUE)
}
require("mlbench")## Loading required package: mlbench
## [1] "C:/Users/USER/AppData/Local/R/win-library/4.3"
## [2] "C:/Program Files/R/R-4.3.2/library"
## [[1]]
## [1] "Amelia" "askpass" "backports" "base64enc"
## [5] "BayesFactor" "beeswarm" "bezier" "BH"
## [9] "BiocManager" "bit" "bit64" "brew"
## [13] "brio" "broom" "bslib" "ca"
## [17] "cachem" "Cairo" "callr" "caret"
## [21] "checkmate" "circlize" "cli" "clipr"
## [25] "clock" "coda" "collections" "colorspace"
## [29] "colourpicker" "commonmark" "contfrac" "corrplot"
## [33] "countrycode" "covr" "cowplot" "cpp11"
## [37] "crayon" "credentials" "curl" "cyclocomp"
## [41] "data.table" "deldir" "dendextend" "desc"
## [45] "deSolve" "devtools" "diagram" "diffobj"
## [49] "digest" "downlit" "dplyr" "e1071"
## [53] "ellipsis" "elliptic" "evaluate" "fansi"
## [57] "farver" "fastmap" "fastmatch" "fontawesome"
## [61] "foreach" "formatR" "formattable" "fs"
## [65] "future" "future.apply" "fuzzyjoin" "gapminder"
## [69] "gclus" "generics" "geosphere" "gert"
## [73] "gganimate" "ggbeeswarm" "ggcorrplot" "ggforce"
## [77] "ggplot2" "ggraph" "ggrepel" "gh"
## [81] "gifski" "gitcreds" "glmnet" "GlobalOptions"
## [85] "globals" "glue" "gower" "graphlayouts"
## [89] "gridBase" "gridExtra" "gtable" "hardhat"
## [93] "here" "highr" "hms" "htmltools"
## [97] "htmlwidgets" "httpuv" "httr" "httr2"
## [101] "hunspell" "hypergeo" "igraph" "ini"
## [105] "ipred" "irlba" "isoband" "ISOcodes"
## [109] "iterators" "janeaustenr" "jpeg" "jquerylib"
## [113] "jsonlite" "kableExtra" "knitr" "labeling"
## [117] "languageserver" "later" "lava" "lazyeval"
## [121] "lda" "learnr" "lifecycle" "lintr"
## [125] "listenv" "lubridate" "magick" "magrittr"
## [129] "mallet" "maps" "markdown" "MatrixModels"
## [133] "matrixStats" "memery" "memoise" "mime"
## [137] "miniUI" "mlbench" "mockery" "ModelMetrics"
## [141] "modeltools" "munsell" "mvtnorm" "network"
## [145] "NLP" "numDeriv" "openssl" "packrat"
## [149] "pacman" "pak" "parallelly" "pbapply"
## [153] "permute" "pillar" "pkgbuild" "pkgconfig"
## [157] "pkgdown" "pkgload" "plyr" "png"
## [161] "polyclip" "praise" "prettydoc" "prettyunits"
## [165] "pROC" "processx" "prodlim" "profvis"
## [169] "progress" "progressr" "promises" "proxy"
## [173] "ps" "purrr" "qap" "quadprog"
## [177] "quanteda" "R.cache" "R.methodsS3" "R.oo"
## [181] "R.utils" "R6" "radarchart" "ragg"
## [185] "randomForest" "rappdirs" "rcmdcheck" "RColorBrewer"
## [189] "Rcpp" "RcppArmadillo" "RcppEigen" "RcppParallel"
## [193] "RcppTOML" "readr" "recipes" "registry"
## [197] "rematch2" "remotes" "renv" "reshape2"
## [201] "reticulate" "rex" "rJava" "rlang"
## [205] "rmarkdown" "roxygen2" "rprojroot" "rstudioapi"
## [209] "rversions" "rvest" "sass" "scales"
## [213] "selectr" "seriation" "sessioninfo" "shape"
## [217] "shiny" "shinyBS" "shinycssloaders" "shinyjs"
## [221] "showtext" "showtextdb" "slam" "SnowballC"
## [225] "sourcetools" "sp" "sparkline" "SparseM"
## [229] "SQUAREM" "statnet.common" "stm" "stopwords"
## [233] "stringdist" "stringi" "stringr" "styler"
## [237] "svglite" "sys" "sysfonts" "systemfonts"
## [241] "testthat" "textdata" "textshaping" "tibble"
## [245] "tidygraph" "tidyr" "tidyselect" "tidytext"
## [249] "timechange" "timeDate" "tinytex" "tm"
## [253] "tokenizers" "topicmodels" "TSP" "tweenr"
## [257] "tzdb" "unvotes" "urlchecker" "usethis"
## [261] "utf8" "uuid" "vctrs" "vdiffr"
## [265] "vegan" "vipor" "viridis" "viridisLite"
## [269] "vroom" "waldo" "webfakes" "webshot"
## [273] "whisker" "widyr" "withr" "wordcloud"
## [277] "wordcloud2" "xfun" "xml2" "xmlparsedata"
## [281] "xopen" "xtable" "yaml" "yarrr"
## [285] "zip"
##
## [[2]]
## [1] "base" "boot" "class" "cluster" "codetools"
## [6] "compiler" "datasets" "foreign" "graphics" "grDevices"
## [11] "grid" "KernSmooth" "lattice" "MASS" "Matrix"
## [16] "methods" "mgcv" "nlme" "nnet" "parallel"
## [21] "rpart" "spatial" "splines" "stats" "stats4"
## [26] "survival" "tcltk" "tools" "translations" "utils"
if (!is.element("languageserver", installed.packages()[, 1])) {
install.packages("languageserver", dependencies = TRUE)
}
require("languageserver")## Loading required package: languageserver
## dplyr - For data manipulation ----
if (!is.element("dplyr", installed.packages()[, 1])) {
install.packages("dplyr", dependencies = TRUE)
}
require("dplyr")## Loading required package: dplyr
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
## ggplot2 - For data visualizations using the Grammar for Graphics package ----
if (!is.element("ggplot2", installed.packages()[, 1])) {
install.packages("ggplot2", dependencies = TRUE)
}
require("ggplot2")## Loading required package: ggplot2
## ggrepel - Additional options for the Grammar for Graphics package ----
if (!is.element("ggrepel", installed.packages()[, 1])) {
install.packages("ggrepel", dependencies = TRUE)
}
require("ggrepel")## Loading required package: ggrepel
## ggraph - Additional options for the Grammar for Graphics package ----
if (!is.element("ggraph", installed.packages()[, 1])) {
install.packages("ggraph", dependencies = TRUE)
}
require("ggraph")## Loading required package: ggraph
## tidytext - For text mining ----
if (!is.element("tidytext", installed.packages()[, 1])) {
install.packages("tidytext", dependencies = TRUE)
}
require("tidytext")## Loading required package: tidytext
## tidyr - To tidy messy data ----
if (!is.element("tidyr", installed.packages()[, 1])) {
install.packages("tidyr", dependencies = TRUE)
}
require("tidyr")## Loading required package: tidyr
## widyr - To widen, process, and re-tidy a dataset ----
if (!is.element("widyr", installed.packages()[, 1])) {
install.packages("widyr", dependencies = TRUE)
}
require("widyr")## Loading required package: widyr
## gridExtra - to arrange multiple grid-based plots on a page ----
if (!is.element("gridExtra", installed.packages()[, 1])) {
install.packages("gridExtra", dependencies = TRUE)
}
require("gridExtra")## Loading required package: gridExtra
##
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
##
## combine
## knitr - for dynamic report generation ----
if (!is.element("knitr", installed.packages()[, 1])) {
install.packages("knitr", dependencies = TRUE)
}
require("knitr")## Loading required package: knitr
## kableExtra - for nicely formatted output tables ----
if (!is.element("kableExtra", installed.packages()[, 1])) {
install.packages("kableExtra", dependencies = TRUE)
}
require("kableExtra")## Loading required package: kableExtra
## Error: package or namespace load failed for 'kableExtra':
## .onLoad failed in loadNamespace() for 'kableExtra', details:
## call: !is.null(rmarkdown::metadata$output) && rmarkdown::metadata$output %in%
## error: 'length = 2' in coercion to 'logical(1)'
## formattable - To create a formattable object ----
# A formattable object is an object to which a formatting function and related
# attributes are attached.
if (!is.element("formattable", installed.packages()[, 1])) {
install.packages("formattable", dependencies = TRUE)
}
require("formattable")## Loading required package: formattable
## circlize - To create a cord diagram or visualization ----
# by Gu et al. (2014)
if (!is.element("circlize", installed.packages()[, 1])) {
install.packages("circlize", dependencies = TRUE)
}
require("circlize")## Loading required package: circlize
## ========================================
## circlize version 0.4.15
## CRAN page: https://cran.r-project.org/package=circlize
## Github page: https://github.com/jokergoo/circlize
## Documentation: https://jokergoo.github.io/circlize_book/book/
##
## If you use it in published research, please cite:
## Gu, Z. circlize implements and enhances circular visualization
## in R. Bioinformatics 2014.
##
## This message can be suppressed by:
## suppressPackageStartupMessages(library(circlize))
## ========================================
## memery - For creating data analysis related memes ----
# The memery package generates internet memes that optionally include a
# superimposed inset plot and other atypical features, combining the visual
# impact of an attention-grabbing meme with graphic results of data analysis.
if (!is.element("memery", installed.packages()[, 1])) {
install.packages("memery", dependencies = TRUE)
}
require("memery")## Loading required package: memery
## Loading required package: showtext
## Loading required package: sysfonts
## Loading required package: showtextdb
## magick - For image processing in R ----
if (!is.element("magick", installed.packages()[, 1])) {
install.packages("magick", dependencies = TRUE)
}
require("magick")## Loading required package: magick
## Linking to ImageMagick 6.9.12.98
## Enabled features: cairo, freetype, fftw, ghostscript, heic, lcms, pango, raw, rsvg, webp
## Disabled features: fontconfig, x11
## yarrr - To create a pirate plot ----
if (!is.element("yarrr", installed.packages()[, 1])) {
install.packages("yarrr", dependencies = TRUE)
}
require("yarrr")## Loading required package: yarrr
## Loading required package: jpeg
## Loading required package: BayesFactor
## Loading required package: coda
## Loading required package: Matrix
##
## Attaching package: 'Matrix'
## The following objects are masked from 'package:tidyr':
##
## expand, pack, unpack
## ************
## Welcome to BayesFactor 0.9.12-4.5. If you have questions, please contact Richard Morey (richarddmorey@gmail.com).
##
## Type BFManual() to open the manual.
## ************
## yarrr v0.1.5. Citation info at citation('yarrr'). Package guide at yarrr.guide()
## Email me at Nathaniel.D.Phillips.is@gmail.com
##
## Attaching package: 'yarrr'
## The following object is masked from 'package:ggplot2':
##
## diamonds
## radarchart - To create interactive radar charts using ChartJS ----
if (!is.element("radarchart", installed.packages()[, 1])) {
install.packages("radarchart", dependencies = TRUE)
}
require("radarchart")## Loading required package: radarchart
## igraph - To create ngram network diagrams ----
if (!is.element("igraph", installed.packages()[, 1])) {
install.packages("igraph", dependencies = TRUE)
}
require("igraph")## Loading required package: igraph
##
## Attaching package: 'igraph'
## The following object is masked from 'package:BayesFactor':
##
## compare
## The following object is masked from 'package:circlize':
##
## degree
## The following object is masked from 'package:formattable':
##
## normalize
## The following object is masked from 'package:tidyr':
##
## crossing
## The following objects are masked from 'package:dplyr':
##
## as_data_frame, groups, union
## The following objects are masked from 'package:stats':
##
## decompose, spectrum
## The following object is masked from 'package:base':
##
## union
## wordcloud2 - For creating wordcloud by using 'wordcloud2.JS ----
if (!is.element("wordcloud2", installed.packages()[, 1])) {
install.packages("wordcloud2", dependencies = TRUE)
}
require("wordcloud2")## Loading required package: wordcloud2
## readr - Load datasets from CSV files ----
if (!is.element("readr", installed.packages()[, 1])) {
install.packages("readr", dependencies = TRUE)
}
require("readr")## Loading required package: readr
# STEP 2. Customize the Visualizations, Tables, and Colour Scheme ----
# The following defines a blue-grey colour scheme for the visualizations:
## shades of blue and shades of grey
blue_grey_colours_11 <- c("#27408E", "#304FAF", "#536CB5", "#6981c7", "#8da0db",
"#dde5ec", "#c8c9ca", "#B9BCC2", "#A7AAAF", "#888A8E",
"#636569")
blue_grey_colours_6 <- c("#27408E", "#304FAF", "#536CB5",
"#B9BCC2", "#A7AAAF", "#888A8E")
blue_grey_colours_4 <- c("#27408E", "#536CB5",
"#B9BCC2", "#888A8E")
blue_grey_colours_2 <- c("#27408E",
"#888A8E")
blue_grey_colours_1 <- c("#6981c7")
# Custom theme for visualizations
blue_grey_theme <- function() {
theme(
axis.ticks = element_line(
linewidth = 1, linetype = "dashed",
lineend = NULL, color = "#dfdede",
arrow = NULL, inherit.blank = FALSE),
axis.text = element_text(
face = "bold", color = "#3f3f41",
size = 12, hjust = 0.5),
axis.title = element_text(face = "bold", color = "#3f3f41",
size = 14, hjust = 0.5),
plot.title = element_text(face = "bold", color = "#3f3f41",
size = 16, hjust = 0.5),
panel.grid = element_line(
linewidth = 0.1, linetype = "dashed",
lineend = NULL, color = "#dfdede",
arrow = NULL, inherit.blank = FALSE),
panel.background = element_rect(fill = "#f3eeee"),
legend.title = element_text(face = "plain", color = "#3f3f41",
size = 12, hjust = 0),
legend.position = "right"
)
}
# Customize the text tables for consistency using HTML formatting
kable_theme <- function(dat, caption) {
kable(dat, "html", escape = FALSE, caption = caption) %>%
kable_styling(bootstrap_options = c("striped", "condensed", "bordered"),
full_width = FALSE)
}