Hello,
Welcome to the community. Unfortunately, they are very strict on stackoverflow and if you don't have a question setup in a specific way they will simply close it.
Lets start with the .csv read and then we will look at the other one. For the csv one you can simply do the following:
#install.packages("readr")
library(readr)
df_csv <- read_csv("df.csv")
First check that the package can be loaded. If not then remove the # and run the first line. You need to change the df.csv to the name of yours. If this works great. If it doesn't work it might mean that your working directory is not the same as where the file is saved. In that instance you will need to specify the whole path and change the \ to / so it can understand it.
You will see in my code we are reading in the data and allocating it to an object called df_csv. You are able to give it any name. We assign things to objects in this way because then it is evident how they became. You can give it any name.
The excel read should work the same but you might have difficulties finding the package. So let me know if it picks up the install. If it does then the same above should work here.
library(readxl)
df_excel <- read_excel("df.xlsx")
Let me know how you progress.