## ----template:attach_packages, warning=FALSE, message=FALSE-------------- # Load required packages from local library into the R session. library(C50) # Original C5.0 decision tree builder. library(Hmisc) # Escape special LaTeX charaters. library(ROCR) # Use prediction() for evaluation. library(ada) # Model: Adaptive boosting ada(). library(caret) # Unified model builder. library(ckanr) # Access data from CKAN. library(diagram) # Produce a flowchart. library(directlabels) # Dodging labels for ggplot2. library(dplyr) # Wrangling: tbl_df(), group_by(), print(). library(glue) # Format strings. library(ggplot2) # Visualise data. library(grid) # Layout of plots: viewport(). library(lubridate) # Dates and time. library(magrittr) # Data pipelines: %>% %<>% %T>% equals(). library(nnet) # Neural network model builder. library(party) # Conditional trees ctree() cforest(). library(pryr) # Meta tools: object_size(), mem_used(). library(randomForest) # Model: randomForest() na.roughfix() for missing data. library(rattle) # Support: normVarNames(), riskchart(), errorMatrix(). library(readr) # Modern and efficient data reader. library(readxl) # Read Excel spreadsheets: read_excel(). library(rpart) # Model: decision tree rpart(). library(rvest) # Scrape data from the Internet. library(scales) # commas(), percent(). library(stringi) # String concat operator: %s+%. library(stringr) # str_replace_all(). library(tibble) # Table data frame: rownames_to_column(), glimpse(). library(tidyr) # Tidy the dataset: gather(). library(xtable) # Generate LaTeX tables. library(tidyverse) # ggplot2, tibble, tidyr, readr, purr, dplyr, stringr ## ----template:iris_summary, out.lines=7---------------------------------- summary(iris) ## ----template:iris_glimpse, out.lines=NULL------------------------------- glimpse(iris) ## ----template:scatter, fig.height=3.5, echo=FALSE------------------------ iris %>% ggplot(aes(x=Sepal.Length, y=Sepal.Width, colour=Species)) + geom_point()