The code needs some data to go with it. See the FAQ: How to do a minimal reproducible example reprex for beginners.
reprex