shiny apps: data extraction code