Reading a remote Excel file
////////////////////////////

library(openxlsx)
infile<-'http://datayyy.com/data_excel/amexCap.xlsx'
df <- read.xlsx(xlsxFile =infile)

head(df)
> head(df)
  Symbol                          Name MarketCap Exchange
1   AA-P                    Alcoa Inc.      43.6     AMEX
2    AAC          Ableauctions.Com Inc       4.3     AMEX
3    AAU        Almaden Minerals; Ltd.      89.4     AMEX
4    ABL        American Biltrite Inc.      19.1     AMEX
5    ABP Abraxas Petroleum Corporation     219.0     AMEX
6    ACU      Acme United Corporation.      46.9     AMEX
> 
////////////////////////////

read.csv('clipboard') 
////////////////////////////
For a small Excel data set

Step 1: Highlight and copy 

Step 2: issue the following 
        x<- read.csv('clipboard')   

////////////////////////////

Videos
////////////////////////////////////////////////
Dynamic Data Script, 2022, How to import data from Excel files to R | R Programming
  (t6:30)
  https://www.youtube.com/watch?v=q66Gk-DPBh4

R Programming 101,2020, How to import data from excel into R studio. R programming for beginners
  (t8:01)
  https://www.youtube.com/watch?v=cnD1op2Oo3M&t=10s

////////////////////////////////////////////////

Links
////////////////////////////////////////////////

Joubert, Shayna, 2019, R vs. Excel: What’s the Difference?      
    https://graduate.northeastern.edu/resources/r-vs-excel/

R Trader, 2014, A million ways to connect R and Excel 
   https://www.r-bloggers.com/2014/02/a-million-ways-to-connect-r-and-excel/

Radecic, Dario, 2022, R and Excel: How to Combine the Best of Both Worlds
    https://appsilon.com/r-and-excel/

Yan, Yuxing, 2024, a list of Excel files
    datayyy.com/data_excel/list.txt.

Yan, Yuxing, 2024, a list of CSV files
    datayyy.com/data_csv/list.txt.
////////////////////////////////////////////////

Getting sheet names
////////////////////////////

library(readxl)

#infile<- " path/to/your/excel_file.xlsx" 

infile <- system.file(" extdata" ," readTest.xlsx" ,package =" openxlsx"  )
sheet_names <- excel_sheets(infile)

> print(sheet_names)
 [1] " Sheet1"   " Sheet2"   " Sheet 3"  " Sheet 4"  " Sheet 5"  " Sheet 6" 
 [7] " 1"        " 11"       " 111"      " 1111"     " 11111"    " 111111"  

////////////////////////////