-
Notifications
You must be signed in to change notification settings - Fork 0
/
R_day2.R
43 lines (33 loc) · 831 Bytes
/
R_day2.R
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
## Important packages to be used in R----
## Reading data----
library("readxl") # to import xlsx data
library("readr") # CSV and other files
library("datapasta") # copy clipboard
## To handle data
library("dplyr")
library("tidyr")
## Writing data and export into files
library("WriteXLS")
library("writexl")
## Story telling with visualization
library("ggplot2")
library("ggpubr")
library("plotly")
library("ggthemes")
library("viridis")
## Set of most packages
library("tidyverse")
# Let's use these packages and turn them into data driven decision making
data()
data("diamonds")
remove(diamonds)
# let's explore the data
??diamonds
summary(diamonds)
glimpse(diamonds)
head(diamonds, 10)
tail(diamonds)
str(diamonds)
# Visualization and explore the categorical data ----
qplot(diamonds$cut)
qplot(cut, data = diamonds)