Can anyone help me with my R code?

As I told you on a previous post, If you need specific help, please provide a proper reproducible example, also please make sure to follow this guidelines about how to make a good R related question.