- Applied Data Visualization with R and ggplot2
- Dr. Tania Moulik
- 158字
- 2021-07-23 16:59:45
Plotting with qplot and R
Suppose that we want to visualize some of the variables in the built-in datasets. A dataset can contain different kinds of variables, as discussed previously. Here, the climate data includes numerical data, such as the temperature, and categorical data, such as hot or cold. In order to visualize and correlate different kinds of data, we need to understand the nomenclature of the dataset. We'll load a data file and understand the structure of the dataset and its variables by using the qplot and R base package. Let's begin by executing the following steps:
- Plot the temperature variable from the airquality dataset, with hist(airquality$Temp) .
hist is part of the built-in R graphics package.
Take a look at the following output screenshot:

- Use qplot (which is part of the ggplot2 package) to plot a graph, using the same variables.
- Type the qplot(airquality$Temp) command to obtain the output, as shown in the following screenshot:
推薦閱讀
- Mastering Mesos
- Dreamweaver CS3網頁設計50例
- Visual Basic從初學到精通
- 大型數據庫管理系統技術、應用與實例分析:SQL Server 2005
- Apache Spark Deep Learning Cookbook
- JSP從入門到精通
- 我也能做CTO之程序員職業規劃
- 工業機器人安裝與調試
- 電氣控制與PLC技術應用
- Practical Big Data Analytics
- 分析力!專業Excel的制作與分析實用法則
- Flink原理與實踐
- Introduction to R for Business Intelligence
- Windows安全指南
- 青少年VEX IQ機器人實訓課程(初級)