R's a programming language. Gretl is a GUI program that was originally created for teaching econometrics. (You may not be aware that Gretl has been around for many years, so it's a legit question.)
R itself was first released in 1993, and is based on S / S-Plus which date to the 70s...moreover, these have been standard tools since the 80s at least, well before Gretl...