Models in R have a special syntax described here (you can also type help(formula)
into R). They aren't only used in the gls function (lm
also uses them, for instance).
Z ~ x + y
corresponds to the mathematical formula "z = ax + by + c" for every x and y value, for some constants a, b, c.
Z ~ x * y
corresponds to the mathematical formula "z = ax + by + cxy + d" for every x and y value, for some constants a, b, c, d.
Z ~ x / y
corresponds to the mathematical formula "z = ax + bxy + c" for every x and y value, for some constants a, b, c.
Z ~ x:y
corresponds to the mathematical formula "z = axy" for every x and y value, for some constant a.
See this Stack Exchange post for more information