-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01-import-explore-data.Rmd
83 lines (63 loc) · 1.27 KB
/
01-import-explore-data.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
title: "Import explore data"
author: "Kundan K. Rao"
date: "01/12/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Basic data cleaning and exploration
loading dataset in the workspace
# importing the wine dataset
```{r}
library(readr)
data <- read_csv("Wine 0.csv - Wine 0.csv.csv", show_col_types = F)
```
# Check structure of the dataset and data types of variables
```{r}
# structure
str(data)
```
Observation :
1. Every variable is of numeric (double) data types
2. There are 178 observation of 13 variables
# Head and tail of the data set
```{r}
# head
head(data)
```
```{r}
# tail
tail(data)
```
# Checking for null and other types of missing data
```{r}
# any NA in the dataframe
any(is.na(data))
```
```{r}
# total NAs
sum(is.na(data))
```
```{r}
# checkinf if there is any infinite valuesm
f<-function(x){any(is.infinite(x))}
sapply(data,f)
```
```{r}
# Checking for total infinite values
f <- function(x){sum(is.infinite(x))}
sapply(data,f)
```
```{r}
# checking for NaN values
f<-function(x){any(is.nan(x))}
sapply(data,f)
```
```{r}
# total NaN values
f <- function(x){sum(is.nan(x))}
sapply(data,f)
```
Observation: There are neither infinity nor ant NaN values in any variable in whole dataset.