I have a data frame where latitude (lat) values are the names of the rows, and longitude (lon) values are the names of the columns, and for each cell of the data frame is a temperature (temp) value of interest to me (or an NA value) such as:
lon lon lon lon lon lon
lat temp temp temp temp temp temp
lat temp temp temp temp temp temp
lat temp temp temp temp temp temp
lat temp temp temp temp temp temp
My question is, how can I reformat this data frame so that it is in a format of:
C1 C2 C3
R1 lat lon temp
R2 lat lon temp
R3 lat lon temp
R4 lat lon temp
Any help, functions, or example code would be much appreciated!