Data Reshaping with Replication

It really is difficult to figure out what is going on from a screenshot. We really need some sample data.

A handy way to supply sample data is to use the dput() function. See ?dput. If you have a very large data set then something like head(dput(myfile), 100) will likely supply enough data for us to work with.

BTW if you do a str(dat) I expect all of your variables that start with a number such as 13-Jul will have been read in as X13-Jul. R is not happy with variable names that start with a numbur.

For further reference, you might find this helpful.