Think of R as school algebra writ large: f(x) = y. Some object, f acts upon some object, x, to produce some other object, y. Objects have different properties. Some are functions like f, some are arguments, like x and the others have the properties produced by giving x as an argument to f. f is a first-class object, meaning that it can be given as an argument to some other function, g, as in the school case of g(f(x))
Keeping this in mind provides a mental checklist to start troubleshooting.
Is it possible to see all of f, x and y in the context of the current environment?
Because
Your hands can't hit what your eyes can't see.—Mohamed Ali