From 61c936365a3cc32ffc945d63e8a501000cda8b88 Mon Sep 17 00:00:00 2001 From: marton-balazs-kovacs <43272864+marton-balazs-kovacs@users.noreply.github.com> Date: Thu, 10 Jun 2021 22:16:58 +0200 Subject: [PATCH] general update before release --- DESCRIPTION | 5 +- NAMESPACE | 1 + NEWS.md | 16 +++ R/app_ui.R | 98 ++++++++++-------- R/initials.R | 3 +- R/mod_credit_roles.R | 8 +- R/mod_read_spreadsheet.R | 7 +- R/mod_title_page.R | 4 +- R/print_credit_roles.R | 9 +- R/print_funding.R | 4 +- R/print_title_page.R | 7 +- R/print_xml.R | 5 +- R/print_yaml.R | 5 +- R/read_infosheet.R | 4 +- R/validate_infosheet.R | 2 +- _pkgdown.yml | 5 + data-raw/infosheet_template.R | 14 +-- data-raw/infosheet_template_example.R | 11 ++ dev/01_start.R | 3 +- dev/02_dev.R | 4 + dev/03_deploy.R | 1 + inst/app/www/introduction.Rmd | 1 + inst/extdata/infosheet_template_example.csv | 6 ++ man/abbreviate.Rd | 4 +- man/clean_infosheet.Rd | 2 +- man/mod_credit_roles.Rd | 3 + man/mod_title_page.Rd | 3 + man/print_credit_roles.Rd | 7 +- man/print_title_page.Rd | 5 +- man/print_xml.Rd | 5 +- man/print_yaml.Rd | 5 +- .../martonbalazskovacs/tenzing.dcf | 4 +- vignettes/app_use.Rmd | 25 ++++- vignettes/contrib_affil_output.png | Bin 172661 -> 80286 bytes vignettes/funding_output.png | Bin 0 -> 72293 bytes vignettes/human_readable_output.png | Bin 175784 -> 80486 bytes vignettes/infosheet.png | Bin 96392 -> 40278 bytes vignettes/local_use.Rmd | 36 +++++-- vignettes/tenzing_error.png | Bin 169971 -> 66634 bytes vignettes/tenzing_on_open.png | Bin 193257 -> 62601 bytes vignettes/xml_output.png | Bin 235439 -> 153555 bytes vignettes/yaml_output.png | Bin 191624 -> 83178 bytes 42 files changed, 214 insertions(+), 108 deletions(-) create mode 100644 NEWS.md create mode 100644 data-raw/infosheet_template_example.R create mode 100644 inst/extdata/infosheet_template_example.csv create mode 100644 vignettes/funding_output.png diff --git a/DESCRIPTION b/DESCRIPTION index 1f47cd6..172b227 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tenzing Title: Documenting Contributions to Scientific Scholarly Output with CRediT -Version: 0.1.0 +Version: 0.2.0 Authors@R: c(person(given = "Marton", family = "Kovacs", @@ -48,7 +48,8 @@ Imports: callr, clipr, htmlwidgets, - googlesheets4 + googlesheets4, + markdown RoxygenNote: 7.1.1 Suggests: testthat, diff --git a/NAMESPACE b/NAMESPACE index 9403bf6..d53ade9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,6 +2,7 @@ export("%>%") export(add_initials) +export(clean_infosheet) export(mod_about_modal_server) export(mod_about_modal_ui) export(mod_credit_roles_server) diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..c40b773 --- /dev/null +++ b/NEWS.md @@ -0,0 +1,16 @@ +# tenzing 0.2.0 + +## New features +* New output option is added. The new option allows users to generate the funding acknowledgment section of their manuscript. For this output it is possible to use initials or full names. +* For the contributor list output option now it is possible to use initials instead of full names. Users can also choose to list the contributions according to the CRediT taxonomy after the names of the contributors. +* `tenzing` now allows users to read the infosheet directly from Google sheets by providing the share URL of the spreadsheet. +* The app allows users to review their infosheet within the app even if it does not pass the validation checks. +* There are two new columns added to the infosheet: ORCiD iD and Funding. +* The name of the CRediT taxonomy roles in the infosheet are now fixed as well their URLs directing to each role in the taxonomy's documentation. +* The title page output option now allows users to add multiple first authors and prints an additional text listing the names of the shared first authors and the email address of the corresponding author. +* The app got a new, cleaner look. + +## Bug fixes +* The functions that transform full names to initials are updated and now can handle most names correctly. +* The oxford comma is now added to the output options. + diff --git a/R/app_ui.R b/R/app_ui.R index a0af418..8766dee 100644 --- a/R/app_ui.R +++ b/R/app_ui.R @@ -13,25 +13,26 @@ app_ui <- function() { h4(id = "sub-title", "Documenting contributorship with CRediT") ) ), - # Page + # Tenzing tab tabPanel( "tenzing", column(2), column(8, + # First step div( class = "main-steps-container", - div( - class = "main-steps-title-container", - h1("1.", - class = "main-steps-title-number"), - h3("Create your infosheet", - class = "main-steps-title"), div( - class = "help-icon-container", - title = "Copy the infosheet template in Google Drive. Go to File -> Make a copy", - icon("far fa-question-circle", lib = "font-awesome", class = "help-icon") - ) - ), + class = "main-steps-title-container", + h1("1.", + class = "main-steps-title-number"), + h3("Create your infosheet", + class = "main-steps-title"), + div( + class = "help-icon-container", + title = "Copy the infosheet template in Google Drive. Go to File -> Make a copy", + icon("far fa-question-circle", lib = "font-awesome", class = "help-icon") + ) + ), wellPanel( class = "main-steps-panel", tags$p("Duplicate and edit the ", @@ -39,43 +40,45 @@ app_ui <- function() { tags$a(href = "https://docs.google.com/spreadsheets/d/1Gl0cwqN_nTsdFH9yhSvi9NypBfDCEhViGq4A3MnBrG8/edit?usp=sharing", "infosheet template", target="_blank", - style = "display: inline; color: #ffdf57; text-decoration: underline;"), + style = "display: inline; color: #ffdf57; text-decoration: underline;") ) - ), + ), + # Second step div( class = "main-steps-container", - div( - class = "main-steps-title-container", - h1("2.", - class = "main-steps-title-number"), - h3("Load your infosheet", - class = "main-steps-title"), div( - class = "help-icon-container", - title = "Use the share URL of the filled out infosheet and click on the upload button. OR upload your infosheet in a .csv, .tsv or .xlsx format.", - icon("far fa-question-circle", lib = "font-awesome", class = "help-icon") - ) - ), + class = "main-steps-title-container", + h1("2.", + class = "main-steps-title-number"), + h3("Load your infosheet", + class = "main-steps-title"), + div( + class = "help-icon-container", + title = "Use the share URL of the filled out infosheet and click on the upload button. OR upload your infosheet in a .csv, .tsv or .xlsx format.", + icon("far fa-question-circle", lib = "font-awesome", class = "help-icon") + ) + ), wellPanel( class = "main-steps-panel", mod_read_spreadsheet_ui("read_spreadsheet"), mod_show_spreadsheet_ui("show_spreadsheet") - ), - ), + ) + ), + # Third step div( class = "main-steps-container", - div( - class = "main-steps-title-container", - h1("3.", - class = "main-steps-title-number"), - h3("Download the output", - class = "main-steps-title"), div( - class = "help-icon-container", - title = "You need a valid infosheet to generate the outputs. Once you have it, click on one of the output buttons to preview and download the output.", - icon("far fa-question-circle", lib = "font-awesome", class = "help-icon") - ) - ), + class = "main-steps-title-container", + h1("3.", + class = "main-steps-title-number"), + h3("Download the output", + class = "main-steps-title"), + div( + class = "help-icon-container", + title = "You need a valid infosheet to generate the outputs. Once you have it, click on one of the output buttons to preview and download the output.", + icon("far fa-question-circle", lib = "font-awesome", class = "help-icon") + ) + ), wellPanel( class = "main-steps-panel", mod_credit_roles_ui("credit_roles"), @@ -83,14 +86,15 @@ app_ui <- function() { mod_xml_report_ui("xml_report"), mod_show_yaml_ui("show_yaml"), mod_funding_information_ui("funding_information") - ) - ), - HTML("
We recommend using this journal article citation when referring to tenzing: - Holcombe, A. O., Kovacs, M., Aust, F., & Aczel, B. (2020). Documenting contributions to scholarly articles using CRediT and tenzing. Plos one, 15(12), e0244611. - (link to paper)
") + ) + ), + # Citation + HTML("") ), column(2) - ), + ), + # How to use tab tabPanel( "How to use tenzing", wellPanel( @@ -98,12 +102,13 @@ app_ui <- function() { includeMarkdown(app_sys("app/www/introduction.Rmd")) ) ), + # About tab tabPanel( "About", wellPanel( id = "about-panel", - includeMarkdown(app_sys("app/www/about.Rmd")) - ) + includeMarkdown(app_sys("app/www/about.Rmd")) + ) ) ), @@ -134,6 +139,7 @@ golem_add_external_resources <- function(){ tags$link(rel = "stylesheet", type = "text/css", href = "www/custom.css"), # Add custom JS functions tags$script(src = "www/sweet_alert.js"), + # Change window title tags$script("document.title = 'tenzing';"), tags$script(src = "www/tooltip.js"), tags$script(src = "https://cdnjs.cloudflare.com/ajax/libs/prism/1.8.4/prism.min.js"), diff --git a/R/initials.R b/R/initials.R index 018f925..32583bf 100644 --- a/R/initials.R +++ b/R/initials.R @@ -29,11 +29,12 @@ add_initials <- function(infosheet) { #' Abbreviates multiple words to first letters #' #' @param string Character. A character vector with the names +#' @param collapse Character. A string that will be used to separate names #' #' @return Returns a character vector with one element. #' #' @examples -#' tenzing:::abbreviate_middle_names("Franz Jude Wayne") +#' tenzing:::abbreviate("Franz Jude Wayne", collapse = "") abbreviate <- function(string, collapse) { string <- string[string != ""] if(length(string) > 0) { diff --git a/R/mod_credit_roles.R b/R/mod_credit_roles.R index 5b40fad..d3d2c28 100644 --- a/R/mod_credit_roles.R +++ b/R/mod_credit_roles.R @@ -27,7 +27,7 @@ mod_credit_roles_ui <- function(id){ # Module Server -#' @rdname mod_human_readable_report +#' @rdname mod_credit_roles #' @export #' @keywords internal @@ -64,7 +64,7 @@ mod_credit_roles_server <- function(id, input_data){ style = "display:inline-block; float:right;", shinyWidgets::materialSwitch( NS(id, "order_by"), - label = "Author names", + label = "Contributor names", inline = TRUE), span("Roles") ) @@ -94,7 +94,7 @@ mod_credit_roles_server <- function(id, input_data){ ## Switch for order_by input order <- reactive({ - ifelse(input$order_by, "author", "role") + ifelse(input$order_by, "contributor", "role") }) # Download --------------------------- @@ -104,7 +104,7 @@ mod_credit_roles_server <- function(id, input_data){ ## Restructure dataframe for the human readable output to_download <- reactive({ if (all(input_data()[dplyr::pull(credit_taxonomy, `CRediT Taxonomy`)] == FALSE)) { - "There are no CRediT roles checked for either of the contributors." + "There are no CRediT roles checked for any of the contributors." } else { print_credit_roles(infosheet = input_data(), initials = input$initials, order_by = order()) } diff --git a/R/mod_read_spreadsheet.R b/R/mod_read_spreadsheet.R index 72ef4b4..55b4d96 100644 --- a/R/mod_read_spreadsheet.R +++ b/R/mod_read_spreadsheet.R @@ -74,6 +74,10 @@ mod_read_spreadsheet_server <- function(id) { # Reading infosheet --------------------------- # Create one activate reactive from two buttons # If either of the buttons are pressed the reactive fires + # TODO: This current solution is designed for to inputs on the + # same page. However, now that they are separated to two tabs + # the input should be triggered by which tab is open and one + # upload button should be enough. activate <- reactive( if (input$upload_url == 0 & input$upload_file == 0) { NULL @@ -127,10 +131,11 @@ mod_read_spreadsheet_server <- function(id) { } }) + # Hide show spreadsheet on start golem::invoke_js("hideid", "show-div") + # Control show spreadsheet button behaviour based on read observeEvent(activate(),{ - ### Buttons that need a validated infosheet if(!is.null(table_data())) { golem::invoke_js("reable", "#show_spreadsheet-show_data") golem::invoke_js("showid", "show-div") diff --git a/R/mod_title_page.R b/R/mod_title_page.R index bf01378..085abd6 100644 --- a/R/mod_title_page.R +++ b/R/mod_title_page.R @@ -27,7 +27,7 @@ mod_title_page_ui <- function(id){ # Module Server -#' @rdname mod_contribs_affiliation_page +#' @rdname mod_title_page #' @export #' @keywords internal @@ -75,7 +75,7 @@ mod_title_page_server <- function(id, input_data){ ## Restructure dataframe for the contributors affiliation output to_download <- reactive({ - print_title_page(infosheet = input_data()) + print_title_page(infosheet = input_data(), text_format = "rmd") }) ## Set up parameters to pass to Rmd document diff --git a/R/print_credit_roles.R b/R/print_credit_roles.R index d8114e6..ea94585 100644 --- a/R/print_credit_roles.R +++ b/R/print_credit_roles.R @@ -20,14 +20,15 @@ #' @param initials Logical. If true initials will be included instead of full #' names in the output #' @param order_by Character. Whether the contributing authors listed for each role ("role"), or -#' the roles are listed after the name of each author ("author"). +#' the roles are listed after the name of each contributor ("contributor"). #' #' @return The function returns a string containing the CRediT roles #' with the contributors listed for each role they partake in. #' @export #' @examples -#' validate_infosheet(infosheet = infosheet_template) -#' print_credit_roles(infosheet = infosheet_template) +#' example_infosheet <- read_infosheet(infosheet = system.file("extdata", "infosheet_template_example.csv", package = "tenzing", mustWork = TRUE)) +#' validate_infosheet(infosheet = example_infosheet) +#' print_credit_roles(infosheet = example_infosheet) print_credit_roles <- function(infosheet, text_format = "rmd", initials = FALSE, order_by = "role") { # Validate input --------------------------- if (all(infosheet[dplyr::pull(credit_taxonomy, `CRediT Taxonomy`)] == FALSE)) { @@ -90,7 +91,7 @@ print_credit_roles <- function(infosheet, text_format = "rmd", initials = FALSE } # Ordered by authors --------------------------- - } else if (order_by == "author") { + } else if (order_by == "contributor") { # Restructure to fit the chosen order --------------------------- roles_data <- roles_data %>% diff --git a/R/print_funding.R b/R/print_funding.R index bb8a3ff..92c1f0c 100644 --- a/R/print_funding.R +++ b/R/print_funding.R @@ -15,7 +15,7 @@ #' @export print_funding <- function(infosheet, initials = FALSE) { # Validate input --------------------------- - if (all(is.na(infosheet$Funding))) stop("There is no funding information provided for either of the contributors.") + if (all(is.na(infosheet$Funding))) stop("There is no funding information provided for any of the contributors.") # Restructure dataframe --------------------------- if (initials) { @@ -47,7 +47,7 @@ print_funding <- function(infosheet, initials = FALSE) { res <- funding_data %>% dplyr::transmute( - out = glue::glue("{Names} {dplyr::if_else(n_names > 1, 'were', 'was')} supported by the {Funding}")) %>% + out = glue::glue("{Names} {dplyr::if_else(n_names > 1, 'were', 'was')} supported by {Funding}")) %>% dplyr::summarise(out = glue::glue_collapse(out, sep = "; ")) %>% dplyr::mutate(out = stringr::str_c(out, ".")) diff --git a/R/print_title_page.R b/R/print_title_page.R index 0c989ed..a434ab5 100644 --- a/R/print_title_page.R +++ b/R/print_title_page.R @@ -22,8 +22,9 @@ #' \code{Order in publication} column of the infosheet. #' @export #' @examples -#' validate_infosheet(infosheet = infosheet_template) -#' print_title_page(infosheet = infosheet_template) +#' example_infosheet <- read_infosheet(infosheet = system.file("extdata", "infosheet_template_example.csv", package = "tenzing", mustWork = TRUE)) +#' validate_infosheet(infosheet = example_infosheet) +#' print_title_page(infosheet = example_infosheet) print_title_page <- function(infosheet, text_format = "rmd") { # Validation --------------------------- ## Check if there are shared first authors @@ -51,7 +52,7 @@ print_title_page <- function(infosheet, text_format = "rmd") { dplyr::select(-affiliation) %>% dplyr::mutate(affiliation_no = as.character(affiliation_no)) %>% dplyr::group_by(`Order in publication`, Name) %>% - dplyr::summarise(affiliation_no = stringr::str_c(na.omit(affiliation_no), collapse = ", ")) %>% + dplyr::summarise(affiliation_no = stringr::str_c(na.omit(affiliation_no), collapse = ",")) %>% dplyr::mutate(affiliation_no = dplyr::case_when( shared_first & `Order in publication` == 1 ~ paste0(affiliation_no, "*"), TRUE ~ affiliation_no)) %>% diff --git a/R/print_xml.R b/R/print_xml.R index 813a9de..68b3fa1 100644 --- a/R/print_xml.R +++ b/R/print_xml.R @@ -20,8 +20,9 @@ #' listed for each CRediT role they partake in. #' @export #' @examples -#' validate_infosheet(infosheet = infosheet_template) -#' print_xml(infosheet = infosheet_template) +#' example_infosheet <- read_infosheet(infosheet = system.file("extdata", "infosheet_template_example.csv", package = "tenzing", mustWork = TRUE)) +#' validate_infosheet(infosheet = example_infosheet) +#' print_xml(infosheet = example_infosheet) print_xml <- function(infosheet) { # Prepare the infosheet data contrib_data <- diff --git a/R/print_yaml.R b/R/print_yaml.R index 61be337..ffa644d 100644 --- a/R/print_yaml.R +++ b/R/print_yaml.R @@ -18,8 +18,9 @@ #' @return The function returns a YAML document #' @export #' @examples -#' validate_infosheet(infosheet = infosheet_template) -#' print_yaml(infosheet = infosheet_template) +#' example_infosheet <- read_infosheet(infosheet = system.file("extdata", "infosheet_template_example.csv", package = "tenzing", mustWork = TRUE)) +#' validate_infosheet(infosheet = example_infosheet) +#' print_yaml(infosheet = example_infosheet) print_yaml <- function(infosheet) { # Restructure input data affiliation_data <- infosheet %>% diff --git a/R/read_infosheet.R b/R/read_infosheet.R index 2a4f99b..a3b56be 100644 --- a/R/read_infosheet.R +++ b/R/read_infosheet.R @@ -33,8 +33,8 @@ read_infosheet <- function(infosheet_path) { #' of the name columns are empty. #' #' @param infosheet the imported infosheet -#' -#' @return sgllg +#' @export +#' @return The function returns the infosheet without empty additional rows. clean_infosheet <- function(infosheet) { infosheet %>% tibble::as_tibble() %>% diff --git a/R/validate_infosheet.R b/R/validate_infosheet.R index 73e7035..0e18627 100644 --- a/R/validate_infosheet.R +++ b/R/validate_infosheet.R @@ -261,7 +261,7 @@ validate_infosheet <- function(infosheet) { if (nrow(missing) != 0) { list( type = "warning", - message = glue::glue("There is no CRediT taxonomy checked for the following row number(s): ", glue::glue_collapse(missing$rowname, sep = ", ", last = " and "))) + message = glue::glue("No CRediT categories are indicated for the row number(s) that follow, although tenzing will still provide other outputs: ", glue::glue_collapse(missing$rowname, sep = ", ", last = " and "))) } else { list( type = "success", diff --git a/_pkgdown.yml b/_pkgdown.yml index 1262152..61f61bb 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -9,6 +9,7 @@ reference: - infosheet_template - read_infosheet - validate_infosheet + - clean_infosheet - title: Generate Output - desc: Functions to generate outputs - contents: @@ -17,3 +18,7 @@ reference: - print_xml - print_yaml - print_funding + +news: + cran_dates: false + one_page: false diff --git a/data-raw/infosheet_template.R b/data-raw/infosheet_template.R index ed9f336..313e157 100644 --- a/data-raw/infosheet_template.R +++ b/data-raw/infosheet_template.R @@ -1,19 +1,9 @@ template_url <- "https://docs.google.com/spreadsheets/d/1Gl0cwqN_nTsdFH9yhSvi9NypBfDCEhViGq4A3MnBrG8/edit?usp=sharing" -safe_gs_url <- purrr::safely(googlesheets::gs_url) - -gs_info <- safe_gs_url(template_url, visibility = "public") - infosheet_template <- - gs_info$result %>% - googlesheets::gs_read() %>% + template_url %>% + googlesheets4::read_sheet() %>% tibble::as_tibble() %>% dplyr::slice(1:5) - # dplyr::filter_at( - # dplyr::vars(`Primary affiliation`, Firstname, `Middle name`, Surname), - # dplyr::any_vars(!is.na(.))) %>% - # dplyr::mutate_at( - # dplyr::vars('Middle name', 'Email address', 'Secondary affiliation'), - # as.character) usethis::use_data(infosheet_template, overwrite = TRUE, internal = FALSE) diff --git a/data-raw/infosheet_template_example.R b/data-raw/infosheet_template_example.R new file mode 100644 index 0000000..1646231 --- /dev/null +++ b/data-raw/infosheet_template_example.R @@ -0,0 +1,11 @@ +library(tidyverse) +library(googlesheets4) + +template_url <- "https://docs.google.com/spreadsheets/d/1o6jJiX1OeQpFgDAc0jdiqHj5-Z1JzFn3yS-xAhCfjEQ/edit?usp=sharing" + +infosheet_template_example <- + template_url %>% + googlesheets4::read_sheet() %>% + tibble::as_tibble() + +write_csv(infosheet_template_example, "inst/extdata/infosheet_template_example.csv") diff --git a/dev/01_start.R b/dev/01_start.R index 3c5f8c0..c17c460 100644 --- a/dev/01_start.R +++ b/dev/01_start.R @@ -31,7 +31,7 @@ usethis::use_readme_rmd( open = FALSE ) usethis::use_code_of_conduct() usethis::use_lifecycle_badge( "Experimental" ) -usethis::use_news_md( open = FALSE ) +usethis::use_news_md( open = TRUE ) usethis::use_git() ## 1.3 - Add a data-raw folder @@ -39,6 +39,7 @@ usethis::use_git() ## If you have data in your package usethis::use_data_raw( name = "credit_taxonomy", open = FALSE ) usethis::use_data_raw( name = "infosheet_template", open = FALSE ) +usethis::use_data_raw( name = "infosheet_template_example", open = TRUE ) ## 1.4 - Init Tests ## diff --git a/dev/02_dev.R b/dev/02_dev.R index 0c619cb..6699fbc 100644 --- a/dev/02_dev.R +++ b/dev/02_dev.R @@ -35,6 +35,7 @@ usethis::use_package("readxl") usethis::use_package("magrittr") usethis::use_package("yaml") usethis::use_package("rclipboard") +usethis::use_package("markdown") usethis::use_pipe() ## 2.3 Add tests @@ -66,6 +67,9 @@ usethis::use_github() # usethis::use_travis() # usethis::use_appveyor() +## News +pkgdown::build_news() + # You're now set! # go to dev/03_deploy.R rstudioapi::navigateToFile("dev/03_deploy.R") diff --git a/dev/03_deploy.R b/dev/03_deploy.R index a5ec59a..890a07f 100644 --- a/dev/03_deploy.R +++ b/dev/03_deploy.R @@ -2,6 +2,7 @@ # # 4. Test my package +devtools::check() devtools::test() rhub::check_for_cran() diff --git a/inst/app/www/introduction.Rmd b/inst/app/www/introduction.Rmd index f965091..955570b 100644 --- a/inst/app/www/introduction.Rmd +++ b/inst/app/www/introduction.Rmd @@ -12,6 +12,7 @@ output: html_document #### 2. Upload your infosheet * Use the share URL of your infosheet and click on the upload button or + - The share links shouls be made viewable * Upload your infosheet in a .csv, .tsv or .xlsx format - Download your filled out infosheet to your computer (if you use .xlsx format the contributorship information should be on the first sheet) - Click the “Browse” button, locate your infosheet on your computer, and click the upload button diff --git a/inst/extdata/infosheet_template_example.csv b/inst/extdata/infosheet_template_example.csv new file mode 100644 index 0000000..f83d65f --- /dev/null +++ b/inst/extdata/infosheet_template_example.csv @@ -0,0 +1,6 @@ +Order in publication,Firstname,Middle name,Surname,Conceptualization,Data curation,Formal analysis,Funding acquisition,Investigation,Methodology,Project administration,Resources,Software,Supervision,Validation,Visualization,Writing - original draft,Writing - review & editing,Email address,Primary affiliation,Secondary affiliation,Funding,ORCID iD,Corresponding author? +1,Alex,O,Holcombe,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE,TRUE,FALSE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE,NA,University of Sydney,NA,NA,NA,FALSE +1,Marton,NA,Kovacs,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,TRUE,TRUE,TRUE,marton.balazs.kovacs@gmail.com,"Institute of Psychology, ELTE Eotvos Lorand University, Budapest, Hungary","Doctoral School of Psychology, ELTE Eotvos Lorand University, Budapest, Hungary",Important Fund,NA,TRUE +2,Balazs,NA,Aczel,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,TRUE,TRUE,FALSE,FALSE,TRUE,NA,"Institute of Psychology, ELTE Eotvos Lorand University, Budapest, Hungary",NA,National Funding Agency,NA,FALSE +3,Frederik,NA,Aust,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,FALSE,TRUE,NA,"University of Cologne, Cologne, Germany","University of Amsterdam, Amsterdam, Netherlands",NA,NA,FALSE +4,Julien,NA,Colomb,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE,TRUE,FALSE,FALSE,FALSE,TRUE,FALSE,FALSE,FALSE,NA,Humboldt University of Berlin,NA,Important Fund,NA,FALSE diff --git a/man/abbreviate.Rd b/man/abbreviate.Rd index 57f94c7..ae9ba11 100644 --- a/man/abbreviate.Rd +++ b/man/abbreviate.Rd @@ -8,6 +8,8 @@ abbreviate(string, collapse) } \arguments{ \item{string}{Character. A character vector with the names} + +\item{collapse}{Character. A string that will be used to separate names} } \value{ Returns a character vector with one element. @@ -16,5 +18,5 @@ Returns a character vector with one element. Abbreviates multiple words to first letters } \examples{ -tenzing:::abbreviate_middle_names("Franz Jude Wayne") +tenzing:::abbreviate("Franz Jude Wayne", collapse = "") } diff --git a/man/clean_infosheet.Rd b/man/clean_infosheet.Rd index c110d7a..85dabaa 100644 --- a/man/clean_infosheet.Rd +++ b/man/clean_infosheet.Rd @@ -10,7 +10,7 @@ clean_infosheet(infosheet) \item{infosheet}{the imported infosheet} } \value{ -sgllg +The function returns the infosheet without empty additional rows. } \description{ The function deletes any additional rows where all diff --git a/man/mod_credit_roles.Rd b/man/mod_credit_roles.Rd index 8be2325..4d85ea2 100644 --- a/man/mod_credit_roles.Rd +++ b/man/mod_credit_roles.Rd @@ -2,9 +2,12 @@ % Please edit documentation in R/mod_credit_roles.R \name{mod_credit_roles_ui} \alias{mod_credit_roles_ui} +\alias{mod_credit_roles_server} \title{mod_credit_roles_ui and mod_credit_roles_server} \usage{ mod_credit_roles_ui(id) + +mod_credit_roles_server(id, input_data) } \arguments{ \item{id}{shiny id} diff --git a/man/mod_title_page.Rd b/man/mod_title_page.Rd index e597068..d74918c 100644 --- a/man/mod_title_page.Rd +++ b/man/mod_title_page.Rd @@ -2,9 +2,12 @@ % Please edit documentation in R/mod_title_page.R \name{mod_title_page_ui} \alias{mod_title_page_ui} +\alias{mod_title_page_server} \title{mod_title_page_ui and mod_title_page_server} \usage{ mod_title_page_ui(id) + +mod_title_page_server(id, input_data) } \arguments{ \item{id}{shiny id} diff --git a/man/print_credit_roles.Rd b/man/print_credit_roles.Rd index 2f30c73..77c3107 100644 --- a/man/print_credit_roles.Rd +++ b/man/print_credit_roles.Rd @@ -21,7 +21,7 @@ print_credit_roles( names in the output} \item{order_by}{Character. Whether the contributing authors listed for each role ("role"), or -the roles are listed after the name of each author ("author").} +the roles are listed after the name of each contributor ("contributor").} } \value{ The function returns a string containing the CRediT roles @@ -43,8 +43,9 @@ The function is primarily developed to be the part of a shiny app. As the } \examples{ -validate_infosheet(infosheet = infosheet_template) -print_credit_roles(infosheet = infosheet_template) +example_infosheet <- read_infosheet(infosheet = system.file("extdata", "infosheet_template_example.csv", package = "tenzing", mustWork = TRUE)) +validate_infosheet(infosheet = example_infosheet) +print_credit_roles(infosheet = example_infosheet) } \seealso{ Other output functions: diff --git a/man/print_title_page.Rd b/man/print_title_page.Rd index b21ecdd..cb2666a 100644 --- a/man/print_title_page.Rd +++ b/man/print_title_page.Rd @@ -32,8 +32,9 @@ The function is primarily developed to be the part of a shiny app. As the } \examples{ -validate_infosheet(infosheet = infosheet_template) -print_title_page(infosheet = infosheet_template) +example_infosheet <- read_infosheet(infosheet = system.file("extdata", "infosheet_template_example.csv", package = "tenzing", mustWork = TRUE)) +validate_infosheet(infosheet = example_infosheet) +print_title_page(infosheet = example_infosheet) } \seealso{ Other output functions: diff --git a/man/print_xml.Rd b/man/print_xml.Rd index 76a380d..796fbfc 100644 --- a/man/print_xml.Rd +++ b/man/print_xml.Rd @@ -29,8 +29,9 @@ The function is primarily developed to be the part of a shiny app. As the } \examples{ -validate_infosheet(infosheet = infosheet_template) -print_xml(infosheet = infosheet_template) +example_infosheet <- read_infosheet(infosheet = system.file("extdata", "infosheet_template_example.csv", package = "tenzing", mustWork = TRUE)) +validate_infosheet(infosheet = example_infosheet) +print_xml(infosheet = example_infosheet) } \seealso{ Other output functions: diff --git a/man/print_yaml.Rd b/man/print_yaml.Rd index 22d348d..b934e7c 100644 --- a/man/print_yaml.Rd +++ b/man/print_yaml.Rd @@ -27,8 +27,9 @@ The function is primarily developed to be the part of a shiny app. As the } \examples{ -validate_infosheet(infosheet = infosheet_template) -print_yaml(infosheet = infosheet_template) +example_infosheet <- read_infosheet(infosheet = system.file("extdata", "infosheet_template_example.csv", package = "tenzing", mustWork = TRUE)) +validate_infosheet(infosheet = example_infosheet) +print_yaml(infosheet = example_infosheet) } \seealso{ Other output functions: diff --git a/rsconnect/shinyapps.io/martonbalazskovacs/tenzing.dcf b/rsconnect/shinyapps.io/martonbalazskovacs/tenzing.dcf index 4263645..5c414a9 100644 --- a/rsconnect/shinyapps.io/martonbalazskovacs/tenzing.dcf +++ b/rsconnect/shinyapps.io/martonbalazskovacs/tenzing.dcf @@ -5,8 +5,8 @@ account: martonbalazskovacs server: shinyapps.io hostUrl: https://api.shinyapps.io/v1 appId: 1052918 -bundleId: 3377049 +bundleId: 4700876 url: https://martonbalazskovacs.shinyapps.io/tenzing/ -when: 1594398714.37272 +when: 1623327628.16694 asMultiple: FALSE asStatic: FALSE diff --git a/vignettes/app_use.Rmd b/vignettes/app_use.Rmd index cc19d1a..2c7c58c 100644 --- a/vignettes/app_use.Rmd +++ b/vignettes/app_use.Rmd @@ -8,6 +8,7 @@ vignette: > --- ```{r, include = FALSE} +options(rmarkdown.html_vignette.check_title = FALSE) knitr::opts_chunk$set( collapse = TRUE, comment = "#>" @@ -51,12 +52,22 @@ If you hover your mouse over the CRediT taxonomy column names in the Google spre # Upload your infosheet +You can load you infosheet to `tenzing` by either uploading a local file from your computer or pasting the share URL of the Google spreasheet. + +## Uploading a local file + Before uploading your infosheet to the app, first download it to your computer if you haven't already. Use _File -> Download_. The app can process any of three formats: csv, tsv or xlsx (xlsx can have multiple sheets, so be aware that only the first sheet will be used by the app). ```{r, echo = FALSE, out.width = "100%"} knitr::include_graphics('./tenzing_error.png') ``` +## Loading infosheet by URL + +When you load your infosheet by using the share URL of the Google spreadsheet do not forget to use the "Anyone with the link" share option, so `tenzing` has permission to read your spreadsheet. + +## Validating the infosheet + On upload the app checks the validity of your infosheet, with feedback to help you find any problems in your infosheet. Warnings usually do not affect the generated outputs so you can ignore them, although they can highlight possible duplication in your infosheet. In case of an error, the app does not enable the output generating buttons until you fix the error. If you want to look at your uploaded infosheet you can do that by clicking _"Show infosheet"_, and if needed, search or filter the contributors by any column. @@ -67,7 +78,9 @@ By clicking on each of the four output options you will see a preview of the gen Below are the output options: -## Create a human readable report of the contributions +## Create a human readable report of the contributions according to CRediT + +You can choose to show the initials instead of full names by using the toggle switch. Also, you can list the contributions according to the CRediT roles or by the name of the contributor by using the other switch. ```{r, echo = FALSE, out.width = "100%"} knitr::include_graphics('./human_readable_output.png') @@ -75,6 +88,8 @@ knitr::include_graphics('./human_readable_output.png') ## Create the contributors' affiliation page +`tenzing` allows multiple first authors. To include multiple first authors you should use 1 for each author in the infosheet's _Order in publication_ column. `tenzing` will automatically detect that multiple contributors are listed as first author and print an additional statement. In this statement, `tenzing` will include the name and email address of the corresponding author as well so do not forget to provide this information. + ```{r, echo = FALSE, out.width = "100%"} knitr::include_graphics('./contrib_affil_output.png') ``` @@ -92,3 +107,11 @@ This output can be incorporated into manuscript created with the `papaja` packag ```{r, echo = FALSE, out.width = "100%"} knitr::include_graphics('./yaml_output.png') ``` + +## Create funding acknowledgements section + +This output lists each contributor and the name of the funding agency, or the specific grant as included in the _Funding_ column of the infosheet. You can choose to show the initials instead of full names by using the toggle switch. + +```{r, echo = FALSE, out.width = "100%"} +knitr::include_graphics('./funding_output.png') +``` \ No newline at end of file diff --git a/vignettes/contrib_affil_output.png b/vignettes/contrib_affil_output.png index 89a0ac9c1c85fc3d5174651398612048a587f27b..4320b9c543ed8ee45174be01b87472837d36f063 100644 GIT binary patch literal 80286 zcmdqI2T+sS*FK5|1r-n#mC!9HDoT}JB4R_j2#Az`G!a551`r5QQ4nbgN^gSn5)mN~ zniwGTB81RGk0d~(gg`=)8_)54KmGo5@7z0g=6-knnE@ue@4NQeYdw4IwVt)#2os|l zeEWs>b8v9*>D|0~n}dUkmxF_|XfGH0KbOHF9qd25d~e^l!co>Ey2$>r+f~Ob)^<%x`uk;)zIZM!yb|o
zqG3<_JE26UA^auJ!xe@#6~wutRy|S&!}Sl~#t6LyoCN$G48q2PSVRn|SI-kj8=zU7
z6$F1<@0%}%!XV}hIiyg{6fFp9A*Qm=dIWDE0<9S!4r7r9H6)yDq2huymS*?E+!jYE
zHA|87c`Yhol9(6shBTJCkZ_i!X$8t?S{3svYnAgGXjP-+WrP;V;>PZ0cbbD6Lq@6`
z8Vo&YGmbMIe0K%58=_PvtF$dwHQzhFwl!X}5iE8We8_pZ2RteF(N_e4 fh~yHxzY`l=zn>}bc6;b~D92A>Rw3}T#*4MpkNn^I0SmcD)jiz9EZ=s#$QQ}}OU
zXos>+cN7668%@&T?jz#{j6c6dzQ2IlKcQ5YDx&}OIo<9o^EzVz0OR^M)34*O3;$du
z+VTC;nhD#H3V$KN`HmKIKzpw2Fjw fxn-yt-s%V
z8&uJ_Ii@ip7xEGM=q~mOs|TtS4B_J8=r{NgX_n#nVGuEc8i9 ;o{Q)PN}O0Z3t>a~
z8@;zbapwg1ZcQA1jNMXNcKm26wiW8nPTG;vIYA^#=*VhK%@#T~O+JofoO`Vcls+Ya
zbdXaVYe-
k9&Fvd3M0$Lk0pB*wcDy+mDNzxzD
z-i_0%)6P~#E0J0yTTc+$&KAgmWzWiv-5R=be!?%rsMG*IHylSBE90>S`CVM}NluC(
zsQ0hB^^letBXh|)7c>S%2QkZcL;XI?s8)6ijdkgKPG1bNwyJH-Rx$_UU{Nz72%Rz4
zkpvbi%e|icLc)JqaA`igoT(QIfJ?4%7Y!98Gu!0%y-=T?7C6o`(f;&l#KGhT07(t5
z_`$a6c*Pp!`G6Ky{D)YR&7=YiwT$LVQI2s*J{ZHLNA-HZU=N#;oYmHK#i$f*OK9ij
zBRUEax*!d3{G1mx7yN2Dy9p`2xNtWMUCf$0}=5*a+yIJ3E+1YvRRA%rY
z!mH++DZAa?YPs|*->Pma&)b)%+B82V2W=@=<`qeumZa}o9#6PQMQ>C%Hy8lpwR834
zYZ0VsQfQ?6;aN$y)2HKJU;*MuN!MUtHQ>v7QAY(=i<;F1+`Gi@)-GM(KrcjT!?p7@
zJ*8a%GYpp{!%T+eT&obGcPXva`;xaG;d85@be&ODHZ-XuK5aa}No!j3*4z%V6nO%B
zc>Ve+)E-&EP;l(BRXKTmwQgV7Eemc!zB{NRO|V(3R3ka{c%Cipn#-j1rAgA&*!Rin
zE6niO(oPxZfs;_N_zpYnJlVxS@jJ?HWbMsJ9{XkCk`6dw&_0i+@&*6
zNDnNJIEuLdx4qOMCWtuANl(j=D6v(Mpau8`duY`>elu%Ge6W~#&b5b%`HI8%Mbp*$
zXCKmV6D+v|=typlPRVyD(r{#30p?A36~cEub>qg6i1Nb+ay5x95Y?_m;E^rORjcgU6tw-NzJzr^{TVMC&|%=|
zKYEN%-dUyBZM$!aQ>58;N9`$4pk^R|k^yjc&{w{6a>%R`R>A%(?}?8N<1RNQ!&oUV
zS)IfZNA~w~1UDbzVm7>1FO9!;MVM6#w#Pe0LV1@0Hz<<`6=Gh}msoAgoi6i$TkErK
z>$6gvSm7c=Bm1_^_9Lr;BtqG`+$>Kp+l2-i)g?SpVUq;-XCI?Q&(b=?4l6(GsKkAy
zg7gpsdK2`Er1~ws%%TqaMu{`L)R4#+h_L-cW