set cast
n x y
1 1 9 5
2 2 7 15
time x y
1 1 4 3.5
2 2 4 6.5
Akhil Sai
n x y
1 1 9 5
2 2 7 15
time x y
1 1 4 3.5
2 2 4 6.5
# Print recasted dataset using cast() function
cast.data <- cast(molten.data, n~variable, sum)
print(cast.data)
cat("\n")
time.cast <- cast(molten.data, time~variable, mean)
print(time.cast)