I want to import a file named mret7018.sas7bdat in RStudio but I have two issues.
Sounds like a file from SAS to me.
Maybe try haven::read_sas(). Once its read into a data.frame it should be possible to proceed with regular R knowledge.
haven::read_sas()
data.frame