second_el_to_numeric: Second to Numeric

View source: R/secondToNumeric.R

second_el_to_numericR Documentation

Second to Numeric

Description

This function converts a list to numeric for use with highcharter drilldown charts.

Usage

second_el_to_numeric(ls)

Arguments

ls

List to convert to numeric.

Examples

for (i in 1:length(monthNames)){
  x <- lineData() %>%
    filter(MonthName == monthNames[i]) %>%
    group_by(AccountDescription) %>%
    summarise(value = round(sum(Actual) - sum(Budget),2)) %>%
    mutate(name = AccountDescription) %>%
    arrange(-value) %>%
    select(name, value) %>%
    list_parse2() %>%
    second_el_to_numeric()

  assign(paste0("ds",tolower(monthNames[i])),x)

  newList <- list(
    id = tolower(monthNames[i]),
    data = get(paste0("ds",tolower(monthNames[i]))),
    name = "Amount"
  )

  assign(paste0("list",i),newList)
}

jsdeherrera/shinyBoots documentation built on March 9, 2024, 3:03 a.m.