system files for readxl packages
////////////////////////////

library(readxl)
myDir<-system.file(package ="readxl")
myDir<-
[1] "C:/Users/pauly/AppData/Local/R/win-library/4.3/readxl"
> setwd(myDir)
> dir()
 [1] "DESCRIPTION" "doc"         "extdata"     "help"        "html"        "INDEX"       "libs"       
 [8] "LICENSE"     "MD5"         "Meta"        "NAMESPACE"   "NEWS.md"     "R"           "WORDLIST"   
> dir()
 [1] "DESCRIPTION" "doc"         "extdata"     "help"        "html"        "INDEX"      
 [7] "libs"        "LICENSE"     "MD5"         "Meta"        "NAMESPACE"   "NEWS.md"    
[13] "R"           "WORDLIST"   
> 
> dir("extdata/")
 [1] "clippy.xls"    "clippy.xlsx"   "datasets.xls"  "datasets.xlsx"
 [5] "deaths.xls"    "deaths.xlsx"   "geometry.xls"  "geometry.xlsx"
 [9] "type-me.xls"   "type-me.xlsx" 

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

read a system Excel file
////////////////////////////

library(readxl)
myDir<-system.file(package ="readxl")
myDir2<-paste0(myDir,"/extdata")
setwd(myDir2)
files<-dir()
 files
 [1] "clippy.xls"    "clippy.xlsx"   "datasets.xls" 
 [4] "datasets.xlsx" "deaths.xls"    "deaths.xlsx"  
 [7] "geometry.xls"  "geometry.xlsx" "type-me.xls"  
[10] "type-me.xlsx" 
x<-read_excel(files[1])

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

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

library(readxl)
excel_sheets(readxl_example("datasets.xlsx"))
[1] "iris"     "mtcars"   "chickwts" "quakes"  

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

reading a PDF table 
///////////////////////////////////////////////////////

# Step 1: install two Python modules
pip install tabula
pip install tabulate 

# Step 2: ------------------------
import numpy as np
import pandas as pd
from tabula import read_pdf
from tabulate import tabulate
#
infile="http://datayyy.com/data_pdf/data.pdf"
df = read_pdf(infile,pages="all") #address of pdf file
print(tabulate(df))

df2=np.squeeze(df, axis=None)
df3=pd.DataFrame(df2)
df3.to_clipboard(index=False)


infile="http://datayyy.com/doc_pdf/exam2021f.pdf"

# https://www.codespeedy.com/numpy-squeeze-in-python/

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