Below are the solutions to these exercises on data tables with DT. #################### # # # Exercise 1 # # # #################### library(DT) datatable(iris) #################### # # # Exercise 2 # # # #################### library(DT) datatable(iris, class = ‘cell-border stripe’) #################### # # # Exercise 3 # # # #################### library(DT) datatable(mtcars) #################### # # […]

## Creating interactive data tables: Exercises

INTRODUCTION The package DT offers an R “window” to JavaScript DataTables. R uses data in matrices’ or data frames’ form; with DT, they can be displayed as tables on HTML pages. The important thing is that filtering, pagination, sorting, etc. are used to transform it into a really useful tool. Before proceeding, please follow our […]

## How to Create Interactive Data Tables With DT

.INTRODUCTION The package “DT” offers an R “window” to JavaScript DataTables. R uses data in matrices’ or data frames’ form and with DT, they can be displayed as tables on HTML pages. The important thing is that filtering, pagination, sorting, etc. are used to transform it into a really useful tool. PACKAGE INSTALLATION & DATA […]

## Lattice Exercises – Solutions

Below are the solutions to these exercises on Lattice Graphs. #################### # # # Exercise 1 # # # #################### library(lattice) attach(mtcars) gear.f<-factor(gear,levels=c(3,4,5), labels=c(“3gears”,”4gears”,”5gears”)) #################### # # # Exercise 2 # # # #################### library(lattice) attach(mtcars) cyl.f <-factor(cyl,levels=c(4,6,8), labels=c(“4cyl”,”6cyl”,”8cyl”)) #################### # # # Exercise 3 # # # #################### library(lattice) attach(mtcars) densityplot(~mpg, main=”Density Plot”, xlab=”Miles […]

## Lattice Exercises

INTRODUCTION The lattice package is a special visualization package, as it takes base R graphics one step further by providing improved default graphs and the ability to display multivariate relationships. It attempts to improve base R graphics by providing better defaults and the ability to easily display multivariate relationships. Before proceeding, please follow our short […]

## How to Display Multivariate Relationship Graphs With Lattice

INTRODUCTION The lattice package is a special visualization package, as it takes base R graphics one step further by providing improved default graphs and the ability to display multivariate relationships. PACKAGE INSTALLATION & DATA FRAME The first thing you have to do is install and load all the packages that we are going to need […]

## How To Tidy Up Your Dataset – Exercises

INTRODUCTION In general data analysis includes four parts: Data collection, Data manipulation, Data visualization and Data Conclusion or Analysis. The tidyr package is one of the most useful packages for the second category of data manipulation as tidy data is the number one factor for a succesfull analysis. Tidy data means that every column stands […]

## How To Tidy Up Your Dataset – Solutions

Below are the solutions to these exercises on tidyr. #################### # # # Exercise 1 # # # #################### library(tidyr) nba %>% gather(day, points, c(day1points, day2points)) #################### # # # Exercise 2 # # # #################### library(tidyr) nba %>% gather( points,day, c(day1points, day2points)) #################### # # # Exercise 3 # # # #################### library(tidyr) nba […]

## How to tidy up your data set with tidyr

INTRODUCTION In general data analysis includes four parts: Data collection, Data manipulation, Data visualization and Data Insights. The tidyr package is one of the most useful packages for the second category of data manipulation as tidy data is the number one factor for a succesfull analysis. Tidy data means that every column stands for a […]

## Dplyr Basic Functions – Exercises: Solutions

Below are the solutions to these exercises on basic dplyr functions. #################### # # # Exercise 1 # # # #################### library(dplyr) first3 <- select(iris,Sepal.Length,Sepal.Width,Petal.Length) head(first3) #################### # # # Exercise 2 # # # #################### library(dplyr) head(select(iris, -Petal.Width)) #################### # # # Exercise 3 # # # #################### library(dplyr) head(select(iris, starts_with(“P”))) #################### # # […]