I need to find the hourly sun angle (angle at which the sun strikes the Earth) for a particular position (latitude, longitude) for a given day in Belgium. I used sunAngle() from "oce" package for the 31 July 2020. t is the hourly vector starting a 00:00:00 of that day until 00:00:00 of August 1.
lat = 50.879700
long = 4.700712
t0 <- as.POSIXct(paste("2020-07-31", "00:00:00"), tz="")
t <- seq(from=t0, to=t0+86400, by="60 min")
a <- sunAngle(t, lat, long)
After taking a closer look, I found two mistakes that when fixed seem to produce the desired results.
Incorrect time zone: Belgium is in central European time, and thus your tz needs to reflect that as sunAngle works from UTC (it will covert it for you)
You made the mistake of flipping longitude and latitude in the sunAngle function (its first long than lat). So your calculations are operating from somewhere in the middle of the Indian Ocean (looked it up )