Using R to Fix Data Quality: Section 2
2013-04-13 11:52
253 查看
Section 2: Visualizing Variables
Overview
In this section, we will talk about how to create charts and graphs so that you can explore your data in a quick visual summary.Dot Plots & Jitter Plots
An easy way to visualize a single variable is to create a dot plot or a jitter plot.First of all, we can use the way in section 1 to read the CSV file and check the data.
> data=read.csv("weather.csv")
> head(data)
Ozone Solar.R Wind Temp Month Day
1 41 190 7.4 67 5 1
2 36 118 8.0 72 5 2
3 12 149 12.6 74 5 3
4 18 313 11.5 62 5 4
5 NA NA 14.3 56 5 5
6 28 NA 14.9 66 5 6
We can use $ operator to get one column in the table:
> data$OzoneThe easy way to get a dot plot of it:
> stripchart(data$Ozone)The way to get a jitter plot:
> stripchart(data$Ozone, method="jitter")Histograms
Jitter plots can be used in low volume data, but it is not a good way when there is a big number of data. Histograms can give you a better view to visualize it. Histograms can separate the x-axis into partitions and make a count of each partition. As a result,you can see the centralized tendency on it.
The way to make histogram:
> hist(data$Ozone)Try to change breaks:
> hist(data$Ozone,breaks=2)> hist(data$Ozone,breaks=100)
Practice Questions
1. What is the centralized tendency of the Ozone?相关文章推荐
- Using R to Fix Data Quality: Section 1
- Using R to Fix Data Quality: Section 3
- Using R to Fix Data Quality: Section 6
- Using R to Fix Data Quality: Section 4
- Using R to Fix Data Quality: Section 5
- Using R to Fix Data Quality: Section 7
- Using R to Fix Data Quality: Section 8
- Using R to Fix Data Quality: Section 0
- fit the “model” to the training data using that method
- [转]how to split the ng-repeat data with three columns using bootstrap
- Fast convolutional neural network training using selective data sampling: Application to hemorrhage
- [Ramda] Declaratively Map Data Transformations to Object Properties Using Ramda evolve
- How to transfer data to an Excel workbook by using Visual C# 2005 or Visual C# .NET
- [Angular 2] Using Pipes to Filter Data
- Camera raw data directly to image using CxImage
- Using Sqoop2 to import mysql data to HDFS
- Using PowerCLI to get a Datastore from an NAA ID
- Convert non-numeric data to numeric by using LabelEncoder
- How To Perform a Full Export And Exclude Certain Schemas Using The Data Pump API? [ID 1340781.1]
- Add data to the Access database using ADO