Smooth contour plot data

Hello! I’d like to smooth data in a contour plot. I think using a custom function when plotting the data is one way to do this. First I used the custom function to calculate the data means:
mean(O2_umol_kg, na.rm=TRUE)
That works, but:
smooth(mean(O2_umol_kg, na.rm=TRUE))
does not work.

I’ve tried using ‘loess’ instead of ‘smooth’, but there’s something else I’m missing.Thanks for any suggestions!