diff --git a/inst/extdata/tableoftables.xlsx b/inst/extdata/tableoftables.xlsx index 3ea3c31..5c2f7e0 100644 Binary files a/inst/extdata/tableoftables.xlsx and b/inst/extdata/tableoftables.xlsx differ diff --git a/vignettes/available-data.Rmd b/vignettes/available-data.Rmd index e9532f5..ccd0da0 100644 --- a/vignettes/available-data.Rmd +++ b/vignettes/available-data.Rmd @@ -21,10 +21,20 @@ for data sets in other languages available in the package. ```{r} +# define current language of interest +curr_lang <- "en" + # Load the data table_of_tables <- rio::import(system.file("extdata", "tableoftables.xlsx", package = "appliedepidata")) +# Replace the language column with clickable links using the `name` for URLs +table_of_tables <- table_of_tables |> + dplyr::mutate( + og_language = language, + language = paste0('', language, '')) + # Group by unique_identifier, description, and group_identifier to combine languages find_langs <- table_of_tables |> @@ -34,16 +44,19 @@ find_langs <- table_of_tables |> # Join with the original data to retain 'name' and handle suffixes output <- table_of_tables |> - dplyr::filter(language == "en") |> + dplyr::filter(og_language == curr_lang) |> dplyr::select(unique_identifier, name, description, group_identifier) |> dplyr::left_join(find_langs, by = "unique_identifier") |> dplyr::select(name, description, language, group_identifier) # Create an interactive table with reactable reactable::reactable(output, - searchable = TRUE, + searchable = FALSE, filterable = TRUE, pagination = TRUE, - defaultPageSize = 10) + defaultPageSize = 10, + columns = list( + language = reactable::colDef(html = TRUE) # Enable HTML rendering for links + )) ```