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

Reshaping and tidying up erroneous data

Erroneous data is regarded as data that falls outside of what is accepted and what should be rejected by the system. In this section, we will focus on two major activities: reshaping and tidying up erroneous data. With the R programming language, this process can be achieved with the tidyr package. This package is designed specifically for data tidying and works well with manipulated data. It is important that you install this package if you have newly installed the R environment.

The following steps are implemented to include this package in the R environment:

  1. Use the install.packages command to install the tidyr package in its entirety:
> install.packages("tidyr")   

From this, we get the following output:

  1. Now, it is important to include this package in your workspace (R environment). By including it, we can call the necessary libraries and functions associated with this package in the R workspace:
> library(tidyr) 

From this, we get the following output:

Once we have included the tidyr package in our system, we can proceed with reshaping and tidying up the mpg dataset. This process requires the following functions:

  • gather()
  • unite()
  • separate()
  • spread()
主站蜘蛛池模板: 无锡市| 和平区| 克什克腾旗| 万全县| 乳山市| 刚察县| 丽江市| 盐城市| 丰都县| 罗定市| 延安市| 沙河市| 民乐县| 昭觉县| 武冈市| 海宁市| 虎林市| 安多县| 开封市| 民权县| 安泽县| 漳浦县| 鸡西市| 梁河县| 莱阳市| 景洪市| 山西省| 靖西县| 东光县| 阳谷县| 镶黄旗| 嵊州市| 正宁县| 湘西| 毕节市| 新闻| 沾化县| 瑞昌市| 伊金霍洛旗| 德江县| 广灵县|