# \donttest{
# Automatically read from cache (shows menu if multiple files)
# Assign to a variable to use the data
national_data <- read_trend_table()
# Read specific table from cache with suggested name
table_2a <- read_trend_table(table_id = "2a", name = "table_2a")
# Read from a specific file path (manual)
national_data <- read_trend_table("path/to/HCUP_SummaryTrendTables_T2a.xlsx")
# Read a specific sheet with custom name
state_data <- read_trend_table(
"path/to/HCUP_SummaryTrendTables_T2a.xlsx",
sheet = "State",
name = "state_data"
)
# List available sheets first
sheets <- list_trend_table_sheets("path/to/HCUP_SummaryTrendTables_T2a.xlsx")
print(sheets)
# Use the data after assignment
head(national_data)
nrow(national_data)
# }
Run the code above in your browser using DataLab