How to assign a letter grade to the marks while doing the results analysis for examination results of a class?

Hi! Welcome!

cut() is the basic R function for cutting up a numerical vector into a series of categories. Depending on which argument options you choose, you can either split up the numerical range evenly, or set your own breakpoints. In either case, you can supply custom labels. Check out the documentation linked above, or just type ?cut in the console.

If that doesn't suit your problem, I think you'll need to provide more details about what you're doing (ideally including a reproducible example).