library(flexdashboard) library(DT) library(readr) library(purrr) library(dplyr) library(ggplot2) library(gridExtra) library(bibliomatrix) library(tidyr) library(scales) #library(plotly) library(kableExtra) library(glue) library(extrafont) colors_vb <- palette_kth() # Retrieve result tables to use in tabs and key indicators # Get authorbased data for selected org unit_code <- params$unit_code con <- con_bib() unit_members <- abm_researchers(unit_code) unit_publ<- abm_staff_data(con, unit_members) df_copub_countries <- abm_copub_countries_staffbased(con = con, publist = unit_publ) df_copub_orgs <- abm_copub_orgs_staffbased(con = con, publist = unit_publ) df_sdg_year <- abm_sdg_year(con = con, data = unit_publ) df_sdg_table <- abm_sdg_table(con = con, data = unit_publ) DBI::dbDisconnect(con) # Get ABM tables df_diva <- abm_table1(unit_publ) df_diva_full <- abm_table1_full(unit_publ) df_cit3y <- abm_table2(unit_publ) df_cf <- abm_table3(unit_publ) df_jcf <- abm_table4(unit_publ) df_copub <- abm_table5(unit_publ) df_oa <- abm_table6(unit_publ) df_scop_cit <- abm_table_scop_cit(unit_publ) df_scop_normcit <- abm_table_scop_normcit(unit_publ) df_scop_snip <- abm_table_scop_snip(unit_publ) df_scop_copub <- abm_table_scop_copub(unit_publ) df_coverage <- abm_coverage(unit_publ) unit_level<- 2 if (unit_code %in% unit_info()$slug) { unit_label <- unit_info() %>% filter(slug == params$unit_code) %>% pull(unit_long_en) } else { unit_label <- abm_divisions() %>% filter(id == unit_code) %>% pull(desc) } unit_file_label<- gsub("/", "_", unit_code) current_date <- format(Sys.Date(), "%Y%m%d") abm_unit_title<- paste0("ABM: ",unit_label) # TODO: change to suitable location for static PDF assets (or other non-HTML resources) STATIC <- "https://kth-library.github.io/abm"
cat(sprintf("<style> .navbar { background-color:%s; } .nav-tabs-custom > .nav-tabs > li > a { font-size: 1.5rem } </style>", colors_vb["cerise"]), '<style type="text/css"> body{ font-family: Figtree; } </style>' )
r unit_label
yrfields <- grep("^[1-2][0-9]{3}$", names(df_diva), value = TRUE) firstyear <- min(yrfields) lastyear <- max(yrfields)
r ifelse(!is.na(lastyear), lastyear, "")
abm_ui_valuebox_publications(df_diva, lastyear, colors_vb["cerise"], unit_label)
r ifelse(!is.na(firstyear), paste(firstyear, "-", lastyear), "")
abm_ui_valuebox_coverage(df_coverage, colors_vb["cerise"], "wos", unit_label)
r ifelse(!is.na(firstyear), paste(firstyear, "-", lastyear), "")
abm_ui_valuebox_coverage(df_coverage, colors_vb["gray"], "scopus", unit_label)
has_rows <- df_cf %>% filter(!is.na(P_frac)) %>% nrow() > 0 last_interval <- ifelse(has_rows, nth(df_cf$interval, -2), "")
r last_interval
(WoS) {.no-padding .no-mobile}abm_ui_bullet_citations(df_cf)
r last_interval
(WoS) {.no-padding .mobile}abm_ui_bullet_citations(df_cf)
has_rows <- df_jcf %>% filter(!is.na(P_frac)) %>% nrow() > 0 last_interval <- ifelse(has_rows, nth(df_jcf$interval, -2), "")
r last_interval
(WoS) {.no-padding .no-mobile}abm_ui_bullet_journal(df_jcf)
r last_interval
(WoS) {.no-padding .mobile}abm_ui_bullet_journal(df_jcf)
has_rows <- df_copub %>% filter(!is.na(P_full)) %>% nrow > 0 last_interval <- ifelse(has_rows, nth(df_copub$interval, -2), "")
r last_interval
(WoS) {.no-padding .no-mobile}abm_ui_waffle_copub(df_copub)
r last_interval
(WoS) {.no-padding .mobile}abm_ui_waffle_copub(df_copub)
woscov <- df_coverage %>% filter(Publication_Type == "Peer reviewed") %>% summarise(woscov = sum(sumwos_frac) / sum(p_frac)) %>% pull(woscov) cat("<p>Indicators in the Citation impact, Journal impact and Co‑publishing tabs are based on Web of Science publications only. Corresponding Scopus indicators can be found under the Scopus tab.</p>") if(isTRUE(unit_level >= 0) && nrow(df_coverage %>% filter(Publication_Type == "Peer reviewed")) > 0) { #<span title='mytitle' onclick=\"window.location.href='https://KTH-Library.github.io/abm/ABM_guide.pdf';\" style='cursor: pointer;></span>' glue("<p><span title='Legend: 75% or above is good, 60% or above is moderate while lower than 60% is poor'>Overall Web of Science coverage for peer reviewed publications in this unit is ", "{coveragetext(woscov)}, {100*round(woscov, 3)}%.</span></p>") } else { cat("<p><b>Bibliometric results for individual researchers should always be interpreted with caution. </b></br/> Bibliometric indicators work best at an aggregated level, and at the individual level the publication profile of researchers, their collaboration networks and their subject specialization may interact with e.g. the field-normalization of citation indicators. The relatively low publication volume of individuals also makes indicator averages very unreliable. </p>") } cat("<p>Note that the coverage numbers for Web of Science and Scopus apply to publications in the KTH bibliometric database Bibmet. If a WoS-id or Scoupus-id from DiVA can not be matched in Bibmet, it does not count as covered.</p>")
The bibliometric indicators referred are based on publications registered in DiVA. Only publications from currently employed researchers at KTH are included. The rolling nature of this report means that it provides more of a current overview and less of a historic stable trend, since it excludes publications written by researchers that are no longer affiliated to KTH, but have been at some point in time.
Indicators in the Citation impact, Journal impact and Co‑publishing tabs are based on Web of Science publications only. Corresponding Scopus indicators can be found under the Scopus tab.
abm_ui_button_publist( data = unit_publ, is_loggedin = params$embed_data, unit_label = unit_label, unit_code = unit_code, unit_file_label = unit_file_label, is_authorbased = TRUE )
con <- con_bib() researchers <- abm_staff_list(con, unit_code) DBI::dbDisconnect(con) abm_ui_datatable_researchers( data = researchers, unit_file_label = unit_file_label, unit_title = abm_unit_title )
r unit_label
abm_ui_datatable_diva( df_diva, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_diva(df_diva)
abm_ui_datatable_diva_full( df_diva_full, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_diva_full(df_diva_full)
if (nrow(df_diva) > 0) { p <- abm_graph_diva(df_diva) p } else { shiny::HTML("<p><i>There are no publications available for this graph</i></p>") }
if (nrow(df_diva) > 0) { p } else { shiny::HTML("<p><i>There are no publications available for this graph</i></p>") }
if (nrow(df_diva %>% left_join(get_pubtype_order(), by = c("Publication_Type_DiVA" = "diva_publication_type")) %>% filter(WoS_coverage != 0)) > 0) { p <- abm_graph_wos_coverage(df_diva) p } else { shiny::HTML("<p><i>There are no data available for this graph</i></p>") }
if (nrow(df_diva) > 0) { p } else { shiny::HTML("<p><i>There are no publications available for this graph</i></p>") }
r unit_label
abm_ui_datatable_city3y( df_cit3y, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_cit3y(df_cit3y)
abm_ui_datatable_cf( df_cf, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_cf(df_cf)
cat("This table is based on Web of Science publication types Article, Proceedings paper, Review, Letter and Editorial.<br>") if(isTRUE(unit_level >= 0)){ years <- df_cit3y %>% filter(substr(Publication_Year_ch, 1, 1) == "2") %>% pull(Publication_Year_ch) %>% as.integer() mincov <- df_coverage %>% filter(Publication_Type == "Peer reviewed" & Publication_Year %in% years) %>% pull(woscov_frac) %>% min() minpubs <- df_coverage %>% filter(Publication_Type == "Peer reviewed" & Publication_Year %in% years) %>% pull(sumwos_full) %>% min() cat(glue("<span title='Legend: 75% or above is good, 60% or above is moderate while lower than 60% is poor'>Rows are based on at least <b>{minpubs}</b> (full counted) publications with ", "<b>{coveragetext(mincov)}</b> Web of Science coverage (at least <b>{round(100*mincov, 1)}%</b>).<br>", "(DiVA publication types Article, peer review and Conference paper, peer review)<br></span>")) if(minpubs < 50) cat("<b>Indicators based on < 50 publications are considered unreliable</b>") } else { cat("<b>Bibliometric results for individual researchers should always be interpreted with caution.</b>") }
cat("This table is based on Web of Science publication types Article and Review.<br>") if(isTRUE(unit_level >= 0)){ intervals <- df_cf %>% filter(substr(interval, 1, 1) == "2") %>% pull(interval) woscov_cf <- df_coverage %>% filter(Publication_Type == "Article, peer review") woscov_cf <- woscov_cf %>% inner_join(sliding_intervals(min(woscov_cf$Publication_Year), max(woscov_cf$Publication_Year), 3), by = c("Publication_Year" = "x")) %>% filter(interval %in% intervals) %>% group_by(interval) %>% summarise(woscov_frac = sum(sumwos_frac) / sum(p_frac), sumwos_full = sum(sumwos_full)) mincov <- min(woscov_cf$woscov_frac) minpubs <- min(woscov_cf$sumwos_full) cat(glue("<span title='Legend: 75% or above is good, 60% or above is moderate while lower than 60% is poor'>Rows are based on at least <b>{minpubs}</b> (full counted) publications with ", "<b>{coveragetext(mincov)}</b> Web of Science coverage (at least <b>{round(100*mincov, 1)}%</b>).<br>", "(DiVA publication type Article, peer review)<br></span>")) if(minpubs < 50) cat("<b>Indicators based on < 50 publications are considered unreliable</b>") } else { cat("<b>Bibliometric results for individual researchers should always be interpreted with caution.</b>") }
if (df_cf %>% filter(!is.na(P_frac)) %>% nrow() > 0){ abm_graph_cf(df_cf) } else { shiny::HTML("<p><i>There are no publications available for this graph</i></p>") }
if (df_cf %>% filter(!is.na(P_frac)) %>% nrow() > 0){ abm_graph_top10(df_cf) } else { shiny::HTML("<p><i>There are no publications available for this graph</i></p>") }
r unit_label
abm_ui_datatable_jcf( df_jcf, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_jcf(df_jcf)
cat("This table is based on Web of Science publication types Article and Review.<br>") if(isTRUE(unit_level >= 0)){ intervals <- df_jcf %>% filter(substr(interval, 1, 1) == "2") %>% pull(interval) woscov_jcf <- df_coverage %>% filter(Publication_Type == "Article, peer review") woscov_jcf <- woscov_jcf %>% inner_join(sliding_intervals(min(woscov_jcf$Publication_Year), max(woscov_jcf$Publication_Year), 3), by = c("Publication_Year" = "x")) %>% filter(interval %in% intervals) %>% group_by(interval) %>% summarise(woscov_frac = sum(sumwos_frac) / sum(p_frac), sumcov_full = sum(sumwos_full)) mincov <- min(woscov_jcf$woscov_frac) minpubs <- min(woscov_jcf$sumcov_full) cat(glue("<span title='Legend: 75% or above is good, 60% or above is moderate while lower than 60% is poor'>Rows are based on at least <b>{minpubs}</b> (full counted) publications with ", "<b>{coveragetext(mincov)}</b> Web of Science coverage (at least <b>{round(100*mincov, 1)}%</b>).<br>", "(DiVA publication type Article, peer review)<br></span>")) if(minpubs < 50) cat("<b>Indicators based on < 50 publications are considered unreliable</b>") } else { cat("<b>Bibliometric results for individual researchers should always be interpreted with caution.</b>") }
if(df_jcf %>% filter(!is.na(P_frac)) %>% nrow() > 0) { abm_graph_jcf(df_jcf) } else { shiny::HTML("<p><i>There are no publications available for this graph</i></p>") }
if(df_cf %>% filter(!is.na(P_frac)) %>% nrow() > 0) { abm_graph_top20(df_jcf) } else { shiny::HTML("<p><i>There are no publications available for this graph</i></p>") }
r unit_label
abm_ui_datatable_copub( df_copub, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_copub(df_copub)
cat("<hr>") cat("This table is based on Web of Science publication types Article and Review.<br>") if(isTRUE(unit_level >= 0)){ intervals <- df_copub %>% filter(substr(interval, 1, 1) == "2") %>% pull(interval) woscov_copub <- df_coverage %>% filter(Publication_Type == "Article, peer review") woscov_copub <- woscov_copub %>% inner_join(sliding_intervals(min(woscov_copub$Publication_Year), max(woscov_copub$Publication_Year), 3), by = c("Publication_Year" = "x")) %>% filter(interval %in% intervals) %>% group_by(interval) %>% summarise(woscov_full = sum(sumwos_full) / sum(p_full)) mincov <- min(woscov_copub$woscov_full) minpubs <- min(df_copub$P_full) cat(glue("<span title='Legend: 75% or above is good, 60% or above is moderate while lower than 60% is poor'>Rows are based on at least <b>{minpubs}</b> (full counted) publications with ", "<b>{coveragetext(mincov)}</b> Web of Science coverage (at least <b>{round(100*mincov, 1)}%</b>).<br>", "(DiVA publication type Article, peer review)<br></span>")) if(minpubs < 50) cat("<b>Indicators based on < 50 publications are considered unreliable</b>") } else { cat("<b>Bibliometric results for individual researchers should always be interpreted with caution.</b>") } cat("<hr>")
abm_ui_datatable_copub_countries( df_copub_countries, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_copub_countries(df_copub_countries)
abm_ui_datatable_copub_orgs( df_copub_orgs, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_copub_orgs(df_copub_orgs)
r unit_label
abm_ui_datatable_oa( df_oa, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_oa(df_oa)
if (df_oa %>% filter(!is.na(P_tot)) %>% nrow() > 0) { abm_graph_oadata_piechart(df_oa, type = "ggplot") } else { shiny::HTML("<p><i>There are no publications available for this graph</i></p>") }
if (df_oa %>% filter(!is.na(P_tot)) %>% nrow() > 0) { abm_graph_oadata_stackedarea(df_oa) } else { shiny::HTML("<p><i>There are no publications available for this graph</i></p>") }
The Open Access type of the publications was fetched from the Unpaywall REST API. The method to determine the OA type is presented here.
In summary, the different OA types can be described as follows:
Gold: The full text has been found on a publisher website, in a journal that is fully OA.
Hybrid: The full text has been found on a publisher website, in a journal that is not fully OA.
Green: The full text has been found in an institutional repository, such as DiVA.
Bronze: The full text has been found on a publisher website but no OA license could be identified.
N.B.: This table is based on peer-reviewed publications for which Unpaywall could determine the OA type (necessary condition: have a DOI number). Unpaywall's method is empirical and does not strictly equate to copyright license. As a consequence, the OA status of a given publication may vary with time --- for example turning from "Not OA" to "Green" when a full text is added to DiVA.
r unit_label
abm_ui_datatable_scop_copub( df_scop_copub, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_scop_copub(df_scop_copub)
cat("<hr>") cat("This table is based on Scopus publication types Article, Review and Conference Paper.<br>") if(isTRUE(unit_level >= 0)){ intervals <- df_scop_copub %>% filter(substr(interval, 1, 1) == "2") %>% pull(interval) scopcov_copub <- df_coverage %>% filter(Publication_Type == "Peer reviewed") scopcov_copub <- scopcov_copub %>% inner_join(sliding_intervals(min(scopcov_copub$Publication_Year), max(scopcov_copub$Publication_Year), 3), by = c("Publication_Year" = "x")) %>% filter(interval %in% intervals) %>% group_by(interval) %>% summarise(scopcov_full = sum(sumscop_full) / sum(p_full)) mincov <- min(scopcov_copub$scopcov_full) minpubs <- min(df_scop_copub$P_full) cat(glue("<span title='Legend: 75% or above is good, 60% or above is moderate while lower than 60% is poor'>Rows are based on at least <b>{minpubs}</b> (full counted) publications with ", "<b>{coveragetext(mincov)}</b> Scopus coverage (at least <b>{round(100*mincov, 1)}%</b>).<br>", "(DiVA publication types Article, peer review and Conference paper, peer review)<br></span>")) if(minpubs < 50) cat("<b>Indicators based on < 50 publications are considered unreliable</b>") } else { cat("<b>Bibliometric results for individual researchers should always be interpreted with caution.</b>") } cat("<hr>")
r unit_label
abm_ui_datatable_sdg_year( df_sdg_year, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_sdg_year(df_sdg_year)
abm_ui_datatable_sdg_table( df_sdg_table, unit_file_label = unit_file_label, unit_title = abm_unit_title )
abm_ui_kable_sdg_table(df_sdg_table)
cat("This table is based on Scopus publication types Article, Review and Conference Paper.<br>") if(isTRUE(unit_level >= 0)){ years <- df_scop_cit %>% filter(substr(Publication_Year_ch, 1, 1) == "2") %>% pull(Publication_Year_ch) %>% as.integer() mincov <- df_coverage %>% filter(Publication_Type == "Peer reviewed" & Publication_Year %in% years) %>% pull(scopcov_frac) %>% min() minpubs <- df_coverage %>% filter(Publication_Type == "Peer reviewed" & Publication_Year %in% years) %>% pull(sumscop_full) %>% min() cat(glue("<span title='Legend: 75% or above is good, 60% or above is moderate while lower than 60% is poor'>Rows are based on at least <b>{minpubs}</b> (full counted) publications with ", "<b>{coveragetext(mincov)}</b> Scopus coverage (at least <b>{round(100*mincov, 1)}%</b>).<br>", "(DiVA publication types Article, peer review and Conference paper, peer review)<br></span>")) } else { cat("<b>Bibliometric results for individual researchers should always be interpreted with caution.</b>") }
cat("This table is based on Scopus publication types Article, Review and Conference Paper.<br>") if(isTRUE(unit_level >= 0)){ years <- df_scop_cit %>% filter(substr(Publication_Year_ch, 1, 1) == "2") %>% pull(Publication_Year_ch) %>% as.integer() mincov <- df_coverage %>% filter(Publication_Type == "Peer reviewed" & Publication_Year %in% years) %>% pull(scopcov_frac) %>% min() minpubs <- df_coverage %>% filter(Publication_Type == "Peer reviewed" & Publication_Year %in% years) %>% pull(sumscop_full) %>% min() cat(glue("<span title='Legend: 75% or above is good, 60% or above is moderate while lower than 60% is poor'>Rows are based on at least <b>{minpubs}</b> (full counted) publications with ", "<b>{coveragetext(mincov)}</b> Scopus coverage (at least <b>{round(100*mincov, 1)}%</b>).<br>", "(DiVA publication types Article, peer review and Conference paper, peer review)<br></span>")) } else { cat("<b>Bibliometric results for individual researchers should always be interpreted with caution.</b>") }
if(df_sdg_table %>% filter(SDG_Displayname != 'None') %>% nrow() > 0) { abm_graph_sdg(df_sdg_table) } else { shiny::HTML("<p><i>There are no publications available for this graph</i></p>") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.