I tried the one below but failed to apply the simulated parted to my dataset. I can't seem to find any other scripts to use.
https://quantgen.github.io/MTM/vignette.html
Adding fixed effects
Fixed effects can be added in any of the examples presented above by adding an argument XF which is the design matrix for fixed effects. To illustrate we modify Example 1 by: (i) adding a simulated fixed effect, and (ii) including it when fitting the model.
Example 5: Mixed-effects model
rm(list = ls()) library(MTM) library(BGLR) data(wheat) Y