October 2017
Beginner to intermediate
572 pages
26h 1m
English
Perform the following steps to cluster customer data into a hierarchy of clusters:
> customer= read.csv('customer.csv', header=TRUE)
> head(customer)
Output
ID Visit.Time Average.Expense Sex Age
1 1 3 5.7 0 10
2 2 5 14.5 0 27
3 3 16 33.5 0 32
4 4 5 15.9 0 30
5 5 16 24.9 0 23
6 6 3 12.0 0 15
> str(customer)
Output
'data.frame': 60 obs. of 5 variables:
$ ID : int 1 2 3 4 5 6 7 8 9 10 ...
$ Visit.Time : int 3 5 16 5 16 3 12 14 6 3 ...
$ Average.Expense: num 5.7 14.5 33.5 15.9 24.9 12 28.5 18.8 23.8 5.3 ...
$ Sex : int 0 0 0 0 0 0 0 0 0 0 ...
$ Age : int 10 27 32 30 23 15 33 27 16 11 ...
Read now
Unlock full access