Error in R/QTL code

A reprex may help attract answers.