I have a requirement of creating pivot table from dataframe given below :
Kindly help me to get pivot table as given below (I have copied from excel) :
I need exactly given as using R.
To generate the similar set of dataset you can use the command given below :
enter code here
Data1 <- data.frame(
X = sample(1:10),
Y = sample(1:10),
Z = sample(1:10),
count= sample(11:20))
Thanks in advance !