-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathR.R
88 lines (57 loc) · 2.29 KB
/
R.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
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
84
85
86
87
88
Items$'Item Name' <- as.numeric(Items$`Item Name`)
ggplot(Items, aes(x = 'Item Name')) +
geom_bar(stat = "count")
library(tidyverse)
install.packages("dplyr")
library("dplyr")
Gr_City <- Customer %>%
group_by(City) %>%
summarise(Total_Sales = n())
View(Gr_City)
ggplot(Gr_City, aes(x = City, y = Total_Sales)) +
geom_bar()
ggplot()
city_colors <- c("#1F78B4", "#33A02C", "#6A3D9A", "#E31A1C", "#FF7F00",
"#ebc634", "#34eb65", "#685e6e", "#35e8c7", "#e2e835",
"#b36ef0", "#000000")
ggplot(Gr_City, aes(x = City, y = Total_Sales, fill = City)) +
geom_bar(stat = "identity", color = "black") +
scale_fill_manual(values = city_colors) +
theme_minimal()
Gr_Income <- Bills %>%
group_by(Month) %>%
summarise(Income = sum(Interest))
view(Gr_Income)
Gr_Income$Month <- as.factor(Gr_Income$Month)
str(Gr_Income)
month_colors <- c("#1F78B4", "#33A02C", "#6A3D9A", "#E31A1C", "#FF7F00",
"#ebc634", "#34eb65", "#685e6e", "#35e8c7", "#e2e835",
"#b36ef0", "#000000")
ggplot(Gr_Income, aes(x = Month, y = Income, fill = Month)) +
geom_bar(stat = "identity", position = "identity", color = "black") +
scale_fill_manual(values = month_colors) +
theme_minimal()
Gr_Cost <- Bills %>%
group_by(Month) %>%
summarise(Cost = sum(Total))
view(Gr_Income)
Gr_Cost$Month <- as.factor(Gr_Cost$Month)
str(Gr_Cost)
month_colors <- c("#1F78B4", "#33A02C", "#6A3D9A", "#E31A1C", "#FF7F00",
"#ebc634", "#34eb65", "#685e6e", "#35e8c7", "#e2e835",
"#b36ef0", "#000000")
ggplot(Gr_Cost, aes(x = Month, y = Cost, fill = Month)) +
geom_bar(stat = "identity", position = "identity", color = "black") +
scale_fill_manual(values = month_colors) +
theme_minimal()
Gr_Item <- Items %>%
group_by(Item_Name) %>%
summarise(Quantity = n())
View(Gr_Item)
Gr_Item$Item_Name <- as.factor(Gr_Item$Item_Name)
str(Gr_Cost)
Item_colors <- c("#1F78B4", "#33A02C", "#6A3D9A", "#E31A1C", "#FF7F00", "#34eb65")
ggplot(Gr_Item, aes(x = Item_Name, y = Quantity, fill = Item_Name)) +
geom_bar(stat = "identity", position = "identity", color = "black") +
scale_fill_manual(values = Item_colors) +
theme_minimal()