second_el_to_numeric: Second to Numeric

Description Usage Arguments Examples

View source: R/secondToNumeric.R

Description

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

Usage

1

Arguments

ls

List to convert to numeric.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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 May 20, 2019, 2:08 a.m.