The equation of a linear function can be written in the form \(y = mx + b\), where \(m\) is the slope and \(b\) is the y-intercept.
Given that the slope \(m = 2\) and the y-intercept \(b = 7\), we can substitute these values into the equation:
\[ y = 2x + 7 \]
Therefore, the equation of the function is \(y = 2x + 7\).