There are formats to facilitate this; NetCdf comes to mind.
On the other hand for an existing coordinate / value dataset ggplot2::geom_tile() might be easier.
ggplot2::geom_tile()
Have a look at code in this older question; the use case is similar...