FM_fetch_data_format {formods} | R Documentation |
Creates Formatting Information for Datasets
Description
Takes a data frame and information in the site configureation to produce formatting information to make it easier for the user to see data type information.
Usage
FM_fetch_data_format(df, state)
Arguments
df |
Raw dataframe to be built into an rhandsontable. |
state |
Current module state after yaml file has been read. |
Value
list with the following elements:
col_heads: List (element for each column) of formatting information for column headers to be use with rhandsontable.
col_subtext: List (element for each column) of subtext to be displayed in selections using 'pickerInput' from the 'shinyWidgets' package.
Examples
# We need a module state object to use this function:
sess_res = UD_test_mksession(session=list())
state = sess_res$state
data_file_local = system.file(package="formods", "test_data", "TEST_DATA.xlsx")
sheet = "DATA"
df = readxl::read_excel(path=data_file_local, sheet=sheet)
hfmt = FM_fetch_data_format(df, state)
# Column header formatting
head(as.vector(unlist( hfmt[["col_heads"]])))
# Column select subtext
head(as.vector(unlist( hfmt[["col_subtext"]])))
[Package formods version 0.1.6 Index]