From b127e062c203962105bee7a30ebcd892b28381d3 Mon Sep 17 00:00:00 2001 From: ayousry42 Date: Sun, 19 Dec 2021 22:47:20 +0200 Subject: [PATCH] new update --- Data.R | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Data.R b/Data.R index 0e20b82..a7e8307 100644 --- a/Data.R +++ b/Data.R @@ -26,8 +26,8 @@ barplot(CompCashCredit,names.arg = c('Cash','Credit'),horiz = FALSE,col = c(rgb( #Compare between ages and their total spent (Youssri) -ages <- cbind(grocery_entries[6] , grocery_entries[3]) -sum_ages <- aggregate(total ~ age,ages,sum) +age <- cbind(grocery_entries[6] , grocery_entries[3]) +sum_ages <- aggregate(total ~ age,age,sum) plot(sum_ages) @@ -36,5 +36,9 @@ plot(sum_ages) - - +#kmeans --Yousri +name_total_age<-cbind(grocery_entries[5],grocery_entries[3],grocery_entries[6]) +#x<-readline() +keameans<-cbind(grocery_entries[3],grocery_entries[6]) +result<-kmeans(keameans,centers = 10) +final_result<-cbind(name_total_age,result$cluster) \ No newline at end of file