官术网_书友最值得收藏!

Analyzing Different Datasets

We all love to talk about the weather. So, let's work with some weather-related datasets. The datasets contain approximately five years' worth of high-temporal resolution (hourly measurements) data for various weather attributes, such as temperature, humidity, air pressure, and so on. We'll analyze and compare the humidity and weather datasets.

Let's begin by implementing the following steps:

  1. Load the humidity dataset by using the following command:
df_hum <- read.csv("data/historical-hourly-weather-data/humidity.csv")
  1. Load the weather description dataset by using the following command:
df_desc <- read.csv("data/historical-hourly-weather-data/weather_description.csv")
  1. Compare the two datasets by using the str command.

The outcome will be the humidity levels of different cities, as follows:

The weather descriptions of different cities are shown as follows:

The different geometric objects that we will be working with in this chapter are as follows:

One-dimensional objects are used to understand and visualize the characteristics of a single variable, as follows:

  • Histogram
  • Bar chart

Two-dimensional objects are used to visualize the relationship between two variables, as follows:

  • Bar chart
  • Boxplot
  • Line chart
  • Scatter plot

Although geometric objects are also used in base R, they don't follow the structure of the Grammar of Graphics and have different naming conventions, as compared to ggplot2. This is an important distinction, which we will look at in detail later.

主站蜘蛛池模板: 大厂| 武隆县| 淮安市| 万载县| 宝鸡市| 安达市| 徐州市| 喀喇| 桂阳县| 克拉玛依市| 澄迈县| 军事| 黄山市| 潢川县| 江津市| 贞丰县| 丰台区| 定结县| 城固县| 汉阴县| 渭南市| 新巴尔虎左旗| 怀宁县| 丰镇市| 库伦旗| 双柏县| 和平县| 新乡县| 吉安县| 密山市| 闻喜县| 绥阳县| 石台县| 玉门市| 万山特区| 江安县| 思茅市| 广饶县| 佛坪县| 灵宝市| 土默特右旗|