Skip to content

Commit 547a3b7

Browse files
committed
Remove dependency on torgutil.
Fill in README (very basic).
1 parent a5a25d0 commit 547a3b7

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

DESCRIPTION

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Imports:
2727
shinyjs,
2828
stringr,
2929
tidyr,
30-
tigris,
31-
torgutil
30+
tigris
3231
RoxygenNote: 7.1.2
3332
Depends:
3433
R (>= 2.10)

R/mod_filter_functions_ui.R

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
tbl_as_named_list <- function(tbl, value_col, name_col) {
2+
# Given a table and two columns, build a named list.
3+
# Copied from torgutil
4+
result <- tbl %>% dplyr::pull({{value_col}}) %>% as.list()
5+
names(result) <- tbl %>% dplyr::pull({{name_col}}) %>% as.list()
6+
result
7+
}
8+
9+
110
filter_ui_make_filter_value_choice_list <-
211
function(table, table_name, filter_name) {
312
this_filter <- filters %>%
@@ -19,10 +28,10 @@ filter_ui_make_filter_value_choice_list <-
1928
filter_ui_make_filter_choice_list <- function(table_name) {
2029
single_value <- filters %>%
2130
dplyr::filter(table==table_name, is.na(join_table), filter != "all") %>%
22-
torgutil::tbl_as_named_list(filter, display_name)
31+
tbl_as_named_list(filter, display_name)
2332
multi_value <- filters %>%
2433
dplyr::filter(table==table_name, !is.na(join_table)) %>%
25-
torgutil::tbl_as_named_list(filter, display_name)
34+
tbl_as_named_list(filter, display_name)
2635
all <- filters %>%
2736
dplyr::filter(table==table_name, filter=="all") %>%
2837
dplyr::pull(display_name)

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,15 @@
55
[![R-CMD-check](https://github.com/tor-gu/njoaguofdash/workflows/R-CMD-check/badge.svg)](https://github.com/tor-gu/njoaguofdash/actions)
66
<!-- badges: end -->
77

8-
The goal of njoaguofdash is to ...
8+
This is a simply dashboard application to illustrate the R data package
9+
[njoaguof](https://github.com/tor-gu/njoaguof)
910

1011
## Installation
1112

12-
You can install the development version of njoaguofdash from [GitHub](https://github.com/) with:
13+
You can install the latest version of njoaguofdash from [GitHub](https://github.com/) with:
1314

1415
``` r
1516
# install.packages("devtools")
1617
devtools::install_github("tor-gu/njoaguofdash")
1718
```
1819

19-
## Example
20-
21-
This is a basic example which shows you how to solve a common problem:
22-
23-
``` r
24-
library(njoaguofdash)
25-
## basic example code
26-
```
27-

0 commit comments

Comments
 (0)