ggvis Exercises (Part-1)

INTRODUCTION The ggvis package is used to make interactive data visualizations. The fact that it combines shiny’s reactive programming model and dplyr’s grammar of data transformation make it a useful tool for data scientists. This package may allows us to implement features like interactivity, but on the other hand every interactive ggvis plot must be connected to a running R session. Before proceeding, please follow our short tutorial.Look at the examples given and try to understand the logic behind them. Then try to solve the exercises below using R and without looking at the answers. Then check the solutions. to check your answers. Exercise 1 Create a list which will include the variables “Horsepower” and “MPG.city” of the “Cars93” data set. HINT: Use ggvis(). Exercise 2 Use the list you just created to make a scatterplot. HINT: Use layer_points(). Exercise…
Original Post: ggvis Exercises (Part-1)

How to create interactive data visualizations with ggvis

INTRODUCTION The ggvis package is used to make interactive data visualizations. The fact that it combines shiny’s reactive programming model and dplyr’s grammar of data transformation make it a useful tool for data scientists. This package may allows us to implement features like interactivity, but on the other hand every interactive ggvis plot must be connected to a running R session. PACKAGE INSTALLATION & DATA FRAME The first thing you have to do is install and load the ggvis package with:install.packages(“ggvis”)library(ggvis) Moreover we need a data set to work with. Tha dataset we chose in our case is “Cars93” which contains data from 93 Cars on Sale in the USA in 1993 and we can find it in the MASS package which of course must be installed and called too. To install and call those packages and attach the “Cars93”…
Original Post: How to create interactive data visualizations with ggvis

Data visualization with googleVis exercises part 10

Timeline, Merging & Flash charts This is part 10 of our series and we are going to explore the features of some interesting types of charts that googleVis provides like Timeline, Flash and learn how to merge two googleVis charts to one. Read the examples below to understand the logic of what we are going to do and then test yous skills with the exercise set we prepared for you. Lets begin! Answers to the exercises are available here. Package & Data frame As you already know, the first thing you have to do is install and load the googleVis package with:install.packages(“googleVis”)library(googleVis) Secondly we will create an experimental data frame which will be used for our charts’ plotting. You can create it with:datTLc <- data.frame(Position=c(rep(“President”, 3), rep(“Vice”, 3)),Name=c(“Washington”, “Adams”, “Jefferson”,”Adams”, “Jefferson”, “Burr”),start=as.Date(x=rep(c(“1789-03-29”, “1797-02-03″,”1801-02-03”),2)),end=as.Date(x=rep(c(“1797-02-03”, “1801-02-03″,”1809-02-03”),2))) You can explore the “datTLC” data…
Original Post: Data visualization with googleVis exercises part 10

R Markdown exercises part 2

INTRODUCTION R Markdown is one of the most popular data science tools and is used to save and execute code, create exceptional reports whice are easily shareable. The documents that R Markdown provides are fully reproducible and support a wide variety of static and dynamic output formats. Using markdown syntax, which provides an easy way of creating documents that can be converted to many other file types, while embeding R code in the report, so it is not necessary to keep the report and R script separately. Furthermore The report is written as normal text, so knowledge of HTML is not required. Of course no additional files are needed because everything is incorporated in the HTML file. Before proceeding, please follow our short tutorial.Look at the examples given and try to understand the logic behind them. Then try to…
Original Post: R Markdown exercises part 2

Data visualization with googleVis exercises part 9

Histogram & Calendar chart This is part 9 of our series and we are going to explore the features of two interesting types of charts that googleVis provides like histogram and calendar charts. Read the examples below to understand the logic of what we are going to do and then test yous skills with the exercise set we prepared for you. Lets begin! Answers to the exercises are available here. Package & Data frame As you already know, the first thing you have to do is install and load the googleVis package with:install.packages(“googleVis”)library(googleVis) To run this example we will first create an experimental data frame with:Hist=data.frame(A=rpois(100, 10),B=rpois(100, 20),C=rpois(100, 30)) NOTE: The charts are created locally by your browser. In case they are not displayed at once press F5 to reload the page. All charts require an Internet connection. Histogram…
Original Post: Data visualization with googleVis exercises part 9

R Markdown exercises part 1

INTRODUCTION R Markdown is one of the most popular data science tools and is used to save and execute code, create exceptional reports whice are easily shareable. The documents that R Markdown provides are fully reproducible and support a wide variety of static and dynamic output formats. Using markdown syntax, which provides an easy way of creating documents that can be converted to many other file types, while embeding R code in the report, so it is not necessary to keep the report and R script separately. Furthermore The report is written as normal text, so knowledge of HTML is not required. Of course no additional files are needed because everything is incorporated in the HTML file. Before proceeding, please follow our short tutorial.Look at the examples given and try to understand the logic behind them. Then try to…
Original Post: R Markdown exercises part 1

Data Visualization with googleVis exercises part 8

Annotation & Sankey Charts In the eighth part of our series we are going to learn about the features of some interesting types of charts. More specifically we will talk about Annotation and Sankey charts. Read the examples below to understand the logic of what we are going to do and then test yous skills with the exercise set we prepared for you. Lets begin! Answers to the exercises are available here. Package As you already know, the first thing you have to do is install and load the googleVis package with:install.packages(“googleVis”)library(googleVis) NOTE: The charts are created locally by your browser. In case they are not displayed at once press F5 to reload the page. All charts require an Internet connection. Annotation chart It is quite simple to create an Annotation Chart with googleVis. We will use the “Stocks”…
Original Post: Data Visualization with googleVis exercises part 8

How to create reports with R Markdown in RStudio

Introduction R Markdown is one of the most popular data science tools and is used to save and execute code to create exceptional reports whice are easily shareable. The documents that R Markdown provides are fully reproducible and support a wide variety of static and dynamic output formats. R Markdown uses markdown syntax, which provides an easy way of creating documents that can be converted to many other file types, while embeding R code in the report, so it is not necessary to keep the report and R script separately. Furthermore The report is written as normal text, so knowledge of HTML is not required. Of course no additional files are needed because everything is incorporated in the HTML file. Package Installation In order to use the R Markdown package we have to install and call it with:install.packages(“rmarkdown”)library(rmarkdown) Create…
Original Post: How to create reports with R Markdown in RStudio

Data visualization with googleVis exercises part 7

Table, Org Chart & Tree MapIn the seventh part of our series we are going to learn about the features of some interesting types of charts. More specifically we will talk about Table, Org Chart and Tree Map. Read the examples below to understand the logic of what we are going to do and then test yous skills with the exercise set we prepared for you. Lets begin! Answers to the exercises are available here. Package As you already know, the first thing you have to do is install and load the googleVis package with:install.packages(“googleVis”)library(googleVis) NOTE: The charts are created locally by your browser. In case they are not displayed at once press F5 to reload the page. Table It is quite simple to create a Table with googleVis. We will use the “Stock” dataset.Look at the example below…
Original Post: Data visualization with googleVis exercises part 7

Data Visualization with googleVis exercises part 6

Geographical Charts In part 6 of this series we are going to see some amazing geographical charts that googleVis provides. Read the examples below to understand the logic of what we are going to do and then test yous skills with the exercise set we prepared for you. Lets begin! Answers to the exercises are available here. Package As you already know, the first thing you have to do is install and load the googleVis package with:install.packages(“googleVis”)library(googleVis) NOTE: The charts are created locally by your browser. In case they are not displayed at once press F5 to reload the page. Geo Chart It is quite simple to create a Geo Chart with googleVis. We will use the “Exports” dataset. First let’s take a look at it with head(Exports). As you can see there are three variables (“Country”, “Profit”, “Online”)…
Original Post: Data Visualization with googleVis exercises part 6