Creating own boxcox code

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers.

For your question, it would be particularly helpful due to a syntax error as posted. Also, what argument x is the function intended to take?