diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml deleted file mode 100644 index b32be559..00000000 --- a/.github/workflows/R-CMD-check.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -name: R-CMD-check - -jobs: - R-CMD-check: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - uses: r-lib/actions/check-r-package@v2 diff --git a/.github/workflows/check-standard.yaml b/.github/workflows/check-standard.yaml new file mode 100644 index 00000000..14159b77 --- /dev/null +++ b/.github/workflows/check-standard.yaml @@ -0,0 +1,50 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 381410b2..f60d0479 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -14,7 +14,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: @@ -28,3 +28,5 @@ jobs: - name: Lint run: lintr::lint_package() shell: Rscript {0} + env: + LINTR_ERROR_ON_LINT: true diff --git a/DESCRIPTION b/DESCRIPTION index 12ae5bc8..d89144f7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -36,4 +36,4 @@ Suggests: Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 diff --git a/R/app_server.R b/R/app_server.R index 4fbbee71..f6c4318c 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -83,30 +83,34 @@ app_server = function(input, output, session) { shiny::bindCache(input$widgetChoice) -# Mutation colouring ------------------------------------------------------ + # Mutation colouring ------------------------------------------------------ # disable dropdown unless mutation treeview shiny::observe({ choice = ifelse(input$widgetChoice != "", input$widgetChoice, "") # toggle mutation dropdown - shinyjs::toggleElement(id = "mutationChoice", - condition = choice == "tree-mutations.rds") + shinyjs::toggleElement( + id = "mutationChoice", + condition = choice == "tree-mutations.rds" + ) # toggle sequence dropdown - shinyjs::toggleElement(id = "sequenceChoice", - condition = choice == "tree-sequences.rds") + shinyjs::toggleElement( + id = "sequenceChoice", + condition = choice == "tree-sequences.rds" + ) # select input for sequences if (choice == "tree-sequences.rds") { avail_seqs = data.table::as.data.table(available_sequences(data_dir)) names(avail_seqs) = "Sequences" - shiny::updateSelectInput(inputId = "sequenceChoice", - choices = avail_seqs - ) + shiny::updateSelectInput( + inputId = "sequenceChoice", + choices = avail_seqs + ) } }) # get selected nodes from mutation choice shiny::observeEvent(input$mutationChoice, { - nodeChoice = selected_mut_nodes(input$mutationChoice, data_dir) # the 'node' column contains integers that define the IDs for graph-nodes in the htmlwidget @@ -124,11 +128,10 @@ app_server = function(input, output, session) { ) }) -# Sequence colouring ------------------------------------------------------ + # Sequence colouring ------------------------------------------------------ # get selected nodes from sequence choice shiny::observeEvent(input$sequenceChoice, { - nodeChoice = selected_seq_nodes(input$sequenceChoice, data_dir) # the 'node' column contains integers that define the IDs for graph-nodes in the htmlwidget @@ -146,15 +149,17 @@ app_server = function(input, output, session) { ) }) -# Get click --------------------------------------------------------------- + # Get click --------------------------------------------------------------- # get selected cluster id based on widget choice selected_cluster_id = shiny::reactive({ shiny::req(input$widgetChoice) shiny::req(input$treeview_selected) - get_selected_cluster_id(widgetChoice = input$widgetChoice, - treeviewSelected = utils::tail(input$treeview_selected, 1), - data_dir = data_dir) + get_selected_cluster_id( + widgetChoice = input$widgetChoice, + treeviewSelected = utils::tail(input$treeview_selected, 1), + data_dir = data_dir + ) }) %>% shiny::bindCache(input$widgetChoice, input$treeview_selected) @@ -169,9 +174,10 @@ app_server = function(input, output, session) { shiny::req(input$widgetChoice) fname = stringr::str_replace(input$widgetChoice, ".rds", ".md") shiny::includeMarkdown(system.file("app", "www", "content", "treeview", - fname, - package = "tfpbrowser", - mustWork = TRUE)) + fname, + package = "tfpbrowser", + mustWork = TRUE + )) }) # Tables Tab -------------------------------------------------------------- @@ -194,5 +200,4 @@ app_server = function(input, output, session) { cluster_choice = selected_cluster_id, data_dir = data_dir ) - } # end server function diff --git a/R/app_ui.R b/R/app_ui.R index a9451f22..5034af16 100644 --- a/R/app_ui.R +++ b/R/app_ui.R @@ -3,103 +3,83 @@ #' @param request Internal parameter for `{shiny}`. #' @noRd app_ui = function(request) { - data_dir <- get_data_dir() + data_dir = get_data_dir() shiny::tagList( - shinyjs::useShinyjs(), shinybrowser::detect(), - shiny::navbarPage( # title title = place_title_logo(), - header = add_ext_resources(data_dir), # theme - theme = bslib::bs_theme(version = 4, - bootswatch = "minty", - bg = "#EBEEEE", - fg = "#002147", - primary = "#003E74", - secondary = "#9D9D9D"), + theme = bslib::bs_theme( + version = 4, + bootswatch = "minty", + bg = "#EBEEEE", + fg = "#002147", + primary = "#003E74", + secondary = "#9D9D9D" + ), # Input widgets shiny::tabPanel( title = "Data", - shiny::fluidRow( - shiny::column(12, - # use details and summary to create expandable section - htmltools::tags$details( - # preview of expandable section - htmltools::tags$summary("Cluster statistics (click to expand)"), - - shiny::br(), - - # text to print choice - shiny::textOutput("select_text"), - shiny::br(), - - # output options - shiny::tabsetPanel(id = "plot_tabs", - - # Tables tab - tablesUI("table1"), - - # Plots tab - plotsUI("plot1"), - - # RDS tab - rdsUI("rds1") - - ) - ) - ) + shiny::column(12, clusterStatsUI(id = NULL)) ), # end fluid row # Bottom row - show tree (static html output from tfpscanner) shiny::fluidRow( shiny::column(12, - id="view-container", - shiny::div(id="view-selection", - htmltools::tags$details( - id="sidebar-toggle", - open="open", - `aria-role`="button", - `aria-label`="Toggle sidebar visibility", - htmltools::tags$summary( - shiny::span(">>"), - shiny::span("<<") - ) - ), - # choose type of treeview - shiny::selectInput(inputId = "widgetChoice", - label = "View", - choices = c("None" = ""), - selectize = FALSE), - - # choose type of mutation - shiny::selectInput(inputId = "mutationChoice", - label = "Mutation", - choices = character(0), - selectize = FALSE), - - # choose type of sequence - shiny::selectInput(inputId = "sequenceChoice", - label = "Sequence", - choices = NULL, - selectize = FALSE), + id = "view-container", + shiny::div( + id = "view-selection", + htmltools::tags$details( + id = "sidebar-toggle", + open = "open", + `aria-role` = "button", + `aria-label` = "Toggle sidebar visibility", + htmltools::tags$summary( + shiny::span(">>"), + shiny::span("<<") + ) + ), + # choose type of treeview + shiny::selectInput( + inputId = "widgetChoice", + label = "View", + choices = c("None" = ""), + selectize = FALSE + ), + + # choose type of mutation + shiny::selectInput( + inputId = "mutationChoice", + label = "Mutation", + choices = character(0), + selectize = FALSE + ), + + # choose type of sequence + shiny::selectInput( + inputId = "sequenceChoice", + label = "Sequence", + choices = NULL, + selectize = FALSE + ), ), - shiny::div(id="view-graphic", - # markdown files to add description - shiny::uiOutput("tree_md_files"), - - # show treeview widget - shiny::wellPanel( - ggiraph::girafeOutput("treeview"), - style = "background: white; height: 1800px;", - ), - shiny::br() + shiny::div( + id = "view-graphic", + # markdown files to add description + shiny::uiOutput("tree_md_files"), + + # show treeview widget + shiny::wellPanel( + ggiraph::girafeOutput("treeview"), + style = "background: white; height: 1800px;", + ), + shiny::br() ) ) ) # end fluid row @@ -109,11 +89,10 @@ app_ui = function(request) { shiny::tabPanel( title = "About", shiny::includeMarkdown(system.file("app", "www", "content", "about.md", - package = "tfpbrowser", - mustWork = TRUE)) + package = "tfpbrowser", + mustWork = TRUE + )) ) - ) # end navbar page ) # end tag list - } diff --git a/R/config.R b/R/config.R index 35980394..9217639e 100644 --- a/R/config.R +++ b/R/config.R @@ -7,7 +7,7 @@ #' #' @return Scalar string. The data-directory for use in the app. -get_data_dir <- function() { +get_data_dir = function() { Sys.getenv( "APP_DATA_DIR", system.file("app", "www", "data", package = "tfpbrowser") diff --git a/R/module_cluster_stats.R b/R/module_cluster_stats.R new file mode 100644 index 00000000..f7b13d26 --- /dev/null +++ b/R/module_cluster_stats.R @@ -0,0 +1,28 @@ +clusterStatsUI = function(id) { + ns = NS(id) + + box_content = tagList( + shiny::br(), + + # text to print choice + shiny::textOutput(ns("select_text")), + shiny::br(), + + # output options + shiny::tabsetPanel( + id = ns("plot_tabs"), + + # Tabs for "Tables", "Plots" and "RDS" + tablesUI(ns("table1")), + plotsUI(ns("plot1")), + rdsUI(ns("rds1")) + ) + ) + + # use details and summary to create expandable section + htmltools::tags$details( + # preview of expandable section + htmltools::tags$summary("Cluster statistics (click to expand)"), + box_content + ) +} diff --git a/R/module_plots.R b/R/module_plots.R index 849feace..596332d0 100644 --- a/R/module_plots.R +++ b/R/module_plots.R @@ -6,11 +6,12 @@ plotsUI = function(id) { ns = shiny::NS(id) # Plots tab panel - downloader_tab_panel(title = "Plots", - chooser_id = ns("plot_type"), - download_button_id = ns("download_plot"), - panel = display_panel(shiny::uiOutput(ns("display_plot")))) - + downloader_tab_panel( + title = "Plots", + chooser_id = ns("plot_type"), + download_button_id = ns("download_plot"), + panel = display_panel(shiny::uiOutput(ns("display_plot"))) + ) } #' Plots tab Server @@ -35,17 +36,20 @@ plotsServer = function(id, cluster_choice, data_dir) { # drop down for plots shiny::observeEvent(all_files(), { - all_images = filter_by_filetype(filenames = all_files(), - filetypes = c("png", "PNG")) + all_images = filter_by_filetype( + filenames = all_files(), + filetypes = c("png", "PNG") + ) if (length(all_images) != 0) { shinyjs::enable("plot_type") } else { shinyjs::disable("plot_type") } shiny::updateSelectInput(session, - "plot_type", - label = "Select plot type:", - choices = all_images) + "plot_type", + label = "Select plot type:", + choices = all_images + ) }) # the path to the plot, from the server's perspective @@ -60,7 +64,7 @@ plotsServer = function(id, cluster_choice, data_dir) { plot_url = shiny::reactive({ shiny::req(plot_file()) - plot_subpath <- fs::path_rel(plot_file(), data_dir) + plot_subpath = fs::path_rel(plot_file(), data_dir) glue::glue("data/{plot_subpath}") }) @@ -101,7 +105,5 @@ plotsServer = function(id, cluster_choice, data_dir) { file.copy(plot_file(), file) } ) - }) - } diff --git a/R/module_rds.R b/R/module_rds.R index 438fd544..d2553dc8 100644 --- a/R/module_rds.R +++ b/R/module_rds.R @@ -5,10 +5,12 @@ rdsUI = function(id) { ns = shiny::NS(id) # RDS files tab panel - downloader_tab_panel(title = "RDS Files", - chooser_id = ns("rds_type"), - download_button_id = ns("download_rds"), - panel = display_panel(shiny::uiOutput(ns("display_rds")))) + downloader_tab_panel( + title = "RDS Files", + chooser_id = ns("rds_type"), + download_button_id = ns("download_rds"), + panel = display_panel(shiny::uiOutput(ns("display_rds"))) + ) } #' rds tab Server @@ -33,17 +35,20 @@ rdsServer = function(id, cluster_choice, data_dir) { # drop down for rds shiny::observeEvent(all_files(), { - all_rds = filter_by_filetype(filenames = all_files(), - filetypes = c("rds", "RDS")) + all_rds = filter_by_filetype( + filenames = all_files(), + filetypes = c("rds", "RDS") + ) if (length(all_rds) != 0) { shinyjs::enable("rds_type") } else { shinyjs::disable("rds_type") } shiny::updateSelectInput(session, - "rds_type", - label = "Select RDS file:", - choices = all_rds) + "rds_type", + label = "Select RDS file:", + choices = all_rds + ) }) # get rds file @@ -95,7 +100,5 @@ rdsServer = function(id, cluster_choice, data_dir) { file.copy(rds_file(), file) } ) - }) - } diff --git a/R/module_tables.R b/R/module_tables.R index 063ef6f0..34b72ecb 100644 --- a/R/module_tables.R +++ b/R/module_tables.R @@ -6,10 +6,12 @@ tablesUI = function(id) { ns = shiny::NS(id) # Tables tab panel - downloader_tab_panel(title = "Tables", - chooser_id = ns("table_type"), - download_button_id = ns("download_table"), - panel = display_panel(reactable::reactableOutput(ns("display_table")))) + downloader_tab_panel( + title = "Tables", + chooser_id = ns("table_type"), + download_button_id = ns("download_table"), + panel = display_panel(reactable::reactableOutput(ns("display_table"))) + ) } #' Tables tab Server @@ -34,17 +36,20 @@ tablesServer = function(id, cluster_choice, data_dir) { # drop down for tables shiny::observeEvent(all_files(), { - all_tables = filter_by_filetype(filenames = all_files(), - filetypes = c("csv", "CSV")) + all_tables = filter_by_filetype( + filenames = all_files(), + filetypes = c("csv", "CSV") + ) if (length(all_tables) != 0) { shinyjs::enable("table_type") } else { shinyjs::disable("table_type") } shiny::updateSelectInput(session, - "table_type", - label = "Select table type:", - choices = all_tables) + "table_type", + label = "Select table type:", + choices = all_tables + ) }) # get table file path @@ -72,10 +77,11 @@ tablesServer = function(id, cluster_choice, data_dir) { table_to_display = suppressMessages(readr::read_csv(table_file())) table_to_display_nice = reformat_table(table_to_display) reactable::reactable(table_to_display_nice, - striped = TRUE, - defaultPageSize = 8, - wrap = FALSE, - height = 400) + striped = TRUE, + defaultPageSize = 8, + wrap = FALSE, + height = 400 + ) } else { shiny::p("No tables available.", style = "color: red; text-align: left") } @@ -99,6 +105,5 @@ tablesServer = function(id, cluster_choice, data_dir) { file.copy(table_file(), file) } ) - }) } diff --git a/R/place_title_logo.R b/R/place_title_logo.R index 34863103..b47946db 100644 --- a/R/place_title_logo.R +++ b/R/place_title_logo.R @@ -7,8 +7,10 @@ place_title_logo = function() { shiny::img( src = "www/logo.png", contentType = "image/png", - height = 80, width = 100), - "tpfbrowser") + height = 80, width = 100 + ), + "tfpbrowser" + ) return(title) } diff --git a/R/utils.R b/R/utils.R index a1e145b2..c0f6dd11 100644 --- a/R/utils.R +++ b/R/utils.R @@ -7,9 +7,13 @@ available_treeview = function(data_dir) { file.path(data_dir, "treeview"), pattern = "\\.rds$" ) - all_trees = factor(all_trees, - c(stringr::str_subset(all_trees, "tree"), - stringr::str_subset(all_trees, "sina"))) + all_trees = factor( + all_trees, + c( + stringr::str_subset(all_trees, "tree"), + stringr::str_subset(all_trees, "sina") + ) + ) all_trees = as.character(sort(all_trees)) names(all_trees) = all_trees %>% stringr::str_replace_all("_|-|\\.rds", " ") %>% @@ -73,8 +77,9 @@ get_unique_mutations = function(filename) { get_all_clusters = function(filename) { all_files = list.files(filename) has_no_dot = stringr::str_detect(all_files, - pattern = "\\.", - negate = TRUE) + pattern = "\\.", + negate = TRUE + ) all_clusters = all_files[which(has_no_dot)] return(all_clusters) } @@ -128,7 +133,9 @@ filter_by_filetype = function(filenames, filetypes) { file_names = stringr::str_to_title( stringr::str_replace_all( - gsub("\\..*", "", matching_files), "_", " ")) + gsub("\\..*", "", matching_files), "_", " " + ) + ) names(matching_files) = file_names return(matching_files) @@ -149,14 +156,16 @@ downloader_tab_panel = function(title, shiny::fluidRow( # drop down menu to select dataset shiny::column(3, - align = "center", - shiny::selectInput(chooser_id, - label = "Select type:", - choices = NULL, - selected = NULL), - shiny::br(), - shiny::downloadButton(download_button_id, - label = "Download") + align = "center", + shiny::selectInput(chooser_id, + label = "Select type:", + choices = NULL, + selected = NULL + ), + shiny::br(), + shiny::downloadButton(download_button_id, + label = "Download" + ) ), # display data shiny::column(9, align = "center", panel) @@ -188,7 +197,8 @@ get_selected_cluster_id = function(widgetChoice, filepath = file.path(data_dir, "treeview", "node_lookup", filename) # load look up ids = readr::read_csv(filepath, - col_types = list(readr::col_double(), readr::col_double())) + col_types = list(readr::col_double(), readr::col_double()) + ) selected_cluster = as.numeric(ids[which(ids$data_id == treeviewSelected), 2]) return(selected_cluster) } diff --git a/R/zzz.R b/R/zzz.R index ee0aab51..d198a6b3 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -7,7 +7,9 @@ .onload = function(...) { shiny::addResourcePath( "www", - system.file("www", package = "tfpbrowser", - mustWork = TRUE) + system.file("www", + package = "tfpbrowser", + mustWork = TRUE + ) ) } diff --git a/man/tfpbrowser.Rd b/man/tfpbrowser.Rd index 77e39828..ba256449 100644 --- a/man/tfpbrowser.Rd +++ b/man/tfpbrowser.Rd @@ -2,8 +2,8 @@ % Please edit documentation in R/tfpbrowser.R \docType{package} \name{tfpbrowser} -\alias{tfpbrowser} \alias{tfpbrowser-package} +\alias{tfpbrowser} \title{\code{{tfpbrowser}} package} \description{ An R package to build a Shiny application to explore {tfpscanner} outputs. diff --git a/renv.lock b/renv.lock index 2b8eca95..c5104925 100644 --- a/renv.lock +++ b/renv.lock @@ -1,7 +1,27 @@ { "R": { - "Version": "4.3.2", + "Version": "4.3.3", "Repositories": [ + { + "Name": "BioCsoft", + "URL": "https://bioconductor.org/packages/3.18/bioc" + }, + { + "Name": "BioCann", + "URL": "https://bioconductor.org/packages/3.18/data/annotation" + }, + { + "Name": "BioCexp", + "URL": "https://bioconductor.org/packages/3.18/data/experiment" + }, + { + "Name": "BioCworkflows", + "URL": "https://bioconductor.org/packages/3.18/workflows" + }, + { + "Name": "BioCbooks", + "URL": "https://bioconductor.org/packages/3.18/books" + }, { "Name": "CRAN", "URL": "https://cloud.r-project.org" @@ -9,7 +29,7 @@ ] }, "Bioconductor": { - "Version": "3.17" + "Version": "3.18" }, "Packages": { "AsioHeaders": { @@ -21,32 +41,32 @@ }, "BiocManager": { "Package": "BiocManager", - "Version": "1.30.20", + "Version": "1.30.22", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "utils" ], - "Hash": "a7fca16a50b6ef7771b49d636dd54b57" + "Hash": "d57e43105a1aa9cb54fdb4629725acb1" }, "BiocVersion": { "Package": "BiocVersion", - "Version": "3.17.1", + "Version": "3.18.1", "Source": "Bioconductor", "git_url": "https://git.bioconductor.org/packages/BiocVersion", - "git_branch": "master", - "git_last_commit": "a2d0c4c", - "git_last_commit_date": "2022-11-02", + "git_branch": "RELEASE_3_18", + "git_last_commit": "70680b8", + "git_last_commit_date": "2023-11-15", "Requirements": [ "R" ], - "Hash": "f7c0d5521799b7b0d0a211143ed0bfcb" + "Hash": "2ecaed86684f5fae76ed5530f9d29c4a" }, "MASS": { "Package": "MASS", - "Version": "7.3-60", + "Version": "7.3-60.0.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "grDevices", @@ -55,15 +75,16 @@ "stats", "utils" ], - "Hash": "a56a6365b3fa73293ea8d084be0d9bb0" + "Hash": "b765b28387acc8ec9e9c1530713cb19c" }, "Matrix": { "Package": "Matrix", - "Version": "1.5-4.1", + "Version": "1.6-5", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", + "grDevices", "graphics", "grid", "lattice", @@ -71,7 +92,7 @@ "stats", "utils" ], - "Hash": "38082d362d317745fb932e13956dccbb" + "Hash": "8c7115cd3a0e048bda2a7cd110549f7a" }, "R6": { "Package": "R6", @@ -95,20 +116,14 @@ }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.10", + "Version": "1.0.12", "Source": "Repository", - "Repository": "RSPM", - "RemoteType": "standard", - "RemotePkgRef": "Rcpp", - "RemoteRef": "Rcpp", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "1.0.10", + "Repository": "CRAN", "Requirements": [ "methods", "utils" ], - "Hash": "e749cae40fa9ef469b6050959517453c" + "Hash": "5ea2700d21e038ace58269ecdbeb9ec0" }, "ape": { "Package": "ape", @@ -131,10 +146,11 @@ }, "aplot": { "Package": "aplot", - "Version": "0.1.10", + "Version": "0.2.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ + "R", "ggfun", "ggplot2", "ggplotify", @@ -143,17 +159,17 @@ "patchwork", "utils" ], - "Hash": "e5ce4f3b5fe236bb879712ff8f956f06" + "Hash": "869a35e6d38fe9936eb578e09091842b" }, "askpass": { "Package": "askpass", - "Version": "1.1", + "Version": "1.2.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "sys" ], - "Hash": "e8a22846fff485f0be3770c2da758713" + "Hash": "cad6cf7f1d5f6e906700b9d3e718c796" }, "backports": { "Package": "backports", @@ -201,16 +217,19 @@ }, "brio": { "Package": "brio", - "Version": "1.1.3", + "Version": "1.1.4", "Source": "Repository", - "Repository": "RSPM", - "Hash": "976cf154dfb043c012d87cddd8bca363" + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "68bd2b066e1fe780bbf62fc8bcc36de3" }, "bslib": { "Package": "bslib", - "Version": "0.4.2", + "Version": "0.6.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "base64enc", @@ -219,62 +238,55 @@ "htmltools", "jquerylib", "jsonlite", + "lifecycle", "memoise", "mime", "rlang", "sass" ], - "Hash": "a7fbf03946ad741129dc81098722fca1" + "Hash": "c0d8599494bc7fb408cd206bbdd9cab0" }, "cachem": { "Package": "cachem", - "Version": "1.0.7", + "Version": "1.0.8", "Source": "Repository", - "Repository": "RSPM", - "RemotePkgRef": "cachem@1.0.7", - "RemoteType": "standard", - "RemoteEtag": "\"79ef8991588f9e5aad4cc465e8fa16aa\"", - "RemotePackaged": "TRUE", - "RemoteRef": "cachem", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "1.0.7", + "Repository": "CRAN", "Requirements": [ "fastmap", "rlang" ], - "Hash": "cda74447c42f529de601fe4d4050daef" + "Hash": "c35768291560ce302c0a6589f92e837d" }, "callr": { "Package": "callr", - "Version": "3.7.3", + "Version": "3.7.5", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", "processx", "utils" ], - "Hash": "9b2191ede20fa29828139b9900922e51" + "Hash": "9f0e4fae4963ba775a5e5c520838c87b" }, "checkmate": { "Package": "checkmate", - "Version": "2.2.0", + "Version": "2.3.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "backports", "utils" ], - "Hash": "ca9c113196136f4a9ca9ce6079c2c99e" + "Hash": "c01cab1cb0f9125211a6fc99d540e315" }, "chromote": { "Package": "chromote", - "Version": "0.1.1", + "Version": "0.2.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R6", "curl", @@ -285,26 +297,21 @@ "processx", "promises", "rlang", + "utils", "websocket" ], - "Hash": "bb5817af24a2d8e6e33e758eb54978be" + "Hash": "3cfaf9cbd331e07055acada321664e12" }, "cli": { "Package": "cli", - "Version": "3.6.1", + "Version": "3.6.2", "Source": "Repository", - "Repository": "RSPM", - "RemoteType": "standard", - "RemotePkgRef": "cli", - "RemoteRef": "cli", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "3.6.1", + "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "89e6d8219950eac806ae0c489052048a" + "Hash": "1216ac65ac55ec0058a6f75d7ca0fd52" }, "clipr": { "Package": "clipr", @@ -342,17 +349,20 @@ }, "commonmark": { "Package": "commonmark", - "Version": "1.9.0", + "Version": "1.9.1", "Source": "Repository", - "Repository": "RSPM", - "Hash": "d691c61bff84bd63c383874d2d0c3307" + "Repository": "CRAN", + "Hash": "5d8225445acb167abf7797de48b2ee3c" }, "cpp11": { "Package": "cpp11", - "Version": "0.4.3", + "Version": "0.4.7", "Source": "Repository", - "Repository": "RSPM", - "Hash": "ed588261931ee3be2c700d22e94a29ab" + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "5a295d7d963cc5035284dcdbaf334f4e" }, "crayon": { "Package": "crayon", @@ -368,9 +378,9 @@ }, "credentials": { "Package": "credentials", - "Version": "1.3.2", + "Version": "2.0.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "askpass", "curl", @@ -378,42 +388,54 @@ "openssl", "sys" ], - "Hash": "93762d0a34d78e6a025efdbfb5c6bb41" + "Hash": "c7844b32098dcbd1c59cbd8dddb4ecc6" + }, + "crosstalk": { + "Package": "crosstalk", + "Version": "1.2.1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R6", + "htmltools", + "jsonlite", + "lazyeval" + ], + "Hash": "ab12c7b080a57475248a30f4db6298c0" }, "curl": { "Package": "curl", - "Version": "5.0.0", + "Version": "5.2.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "e4f97056611e8e6b8b852d13b7400cf1" + "Hash": "411ca2c03b1ce5f548345d2fc2685f7a" }, "data.table": { "Package": "data.table", - "Version": "1.14.8", + "Version": "1.15.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "b4c06e554f33344e044ccd7fdca750a9" + "Hash": "536dfe4ac4093b5d115caed7a1a7223b" }, "desc": { "Package": "desc", - "Version": "1.4.2", + "Version": "1.4.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", "cli", - "rprojroot", "utils" ], - "Hash": "6b9602c7ebbe87101a9c8edb6e8b6d21" + "Hash": "99b79fcbd6c4d1ce087f5c5c758b384f" }, "diffobj": { "Package": "diffobj", @@ -432,20 +454,20 @@ }, "digest": { "Package": "digest", - "Version": "0.6.31", + "Version": "0.6.35", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "8b708f296afd9ae69f450f9640be8990" + "Hash": "698ece7ba5a4fa4559e3d537e7ec3d31" }, "dplyr": { "Package": "dplyr", - "Version": "1.1.2", + "Version": "1.1.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", @@ -462,7 +484,7 @@ "utils", "vctrs" ], - "Hash": "dea6970ff715ca541c387de363ff405e" + "Hash": "fedd9d00c2944ff00a0e2696ccf048ec" }, "ellipsis": { "Package": "ellipsis", @@ -477,32 +499,26 @@ }, "evaluate": { "Package": "evaluate", - "Version": "0.21", + "Version": "0.23", "Source": "Repository", - "Repository": "RSPM", - "RemoteType": "standard", - "RemotePkgRef": "evaluate", - "RemoteRef": "evaluate", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "0.21", + "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "d59f3b464e8da1aef82dc04b588b8dfb" + "Hash": "daf4a1246be12c1fa8c7705a0935c1a0" }, "fansi": { "Package": "fansi", - "Version": "1.0.4", + "Version": "1.0.6", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "grDevices", "utils" ], - "Hash": "1d9e7ad3c8312a192dea7d3db0274fde" + "Hash": "962174cf2aeb5b9eea581522286a911f" }, "farver": { "Package": "farver", @@ -513,39 +529,33 @@ }, "fastmap": { "Package": "fastmap", - "Version": "1.1.0", + "Version": "1.1.1", "Source": "Repository", - "Repository": "RSPM", - "Hash": "77bd60a6157420d4ffa93b27cf6a58b8" + "Repository": "CRAN", + "Hash": "f7736a18de97dea803bde0a2daaafb27" }, "fontawesome": { "Package": "fontawesome", - "Version": "0.5.1", + "Version": "0.5.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "htmltools", "rlang" ], - "Hash": "1e22b8cabbad1eae951a75e9f8b52378" + "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" }, "fs": { "Package": "fs", - "Version": "1.6.2", + "Version": "1.6.3", "Source": "Repository", - "Repository": "RSPM", - "RemoteType": "standard", - "RemotePkgRef": "fs", - "RemoteRef": "fs", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "1.6.2", + "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "94af08e0aa9675a16fadbb3aaaa90d2a" + "Hash": "47b5f30c720c23999b913a1a635cf0bb" }, "generics": { "Package": "generics", @@ -560,9 +570,9 @@ }, "gert": { "Package": "gert", - "Version": "1.9.2", + "Version": "2.0.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "askpass", "credentials", @@ -571,36 +581,31 @@ "sys", "zip" ], - "Hash": "9122b3958e749badb5c939f498038b57" + "Hash": "f70d3fe2d9e7654213a946963d1591eb" }, "ggfun": { "Package": "ggfun", - "Version": "0.0.9", + "Version": "0.1.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ + "R", + "cli", "ggplot2", "grid", "rlang", "utils" ], - "Hash": "c970ab268b09d3c8b0f524294050860f" + "Hash": "91780e07f1d631a1152835b4e25c66b9" }, "ggiraph": { "Package": "ggiraph", - "Version": "0.8.4", + "Version": "0.8.9", "Source": "Repository", - "Repository": "RSPM", - "RemotePkgRef": "ggiraph@0.8.4", - "RemoteType": "standard", - "RemoteEtag": "\"7d55b4cd82be7ae8d95b4ddd0a21b336\"", - "RemotePackaged": "TRUE", - "RemoteRef": "ggiraph", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "0.8.4", + "Repository": "CRAN", "Requirements": [ "Rcpp", + "cli", "ggplot2", "grid", "htmltools", @@ -612,21 +617,13 @@ "uuid", "vctrs" ], - "Hash": "98e3965e27dd3c9bda630b377544e92b" + "Hash": "50a51e9be10ba75fc43ee7fb21c18af0" }, "ggplot2": { "Package": "ggplot2", - "Version": "3.4.0", + "Version": "3.5.0", "Source": "Repository", - "Repository": "RSPM", - "RemotePkgRef": "ggplot2@3.4.0", - "RemoteType": "standard", - "RemoteEtag": "\"bcfaa8d358bfaa987a4aff43c4dfc9da\"", - "RemotePackaged": "TRUE", - "RemoteRef": "ggplot2", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "3.4.0", + "Repository": "CRAN", "Requirements": [ "MASS", "R", @@ -645,13 +642,13 @@ "vctrs", "withr" ], - "Hash": "fd2aab12f54400c6bca43687231e246b" + "Hash": "52ef83f93f74833007f193b2d4c159a2" }, "ggplotify": { "Package": "ggplotify", - "Version": "0.1.0", + "Version": "0.1.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "ggplot2", @@ -661,17 +658,18 @@ "gridGraphics", "yulab.utils" ], - "Hash": "acbcedf783cdb8710168aa0edba42ac0" + "Hash": "1547863db3b472cf7181973acf649f1a" }, "ggtree": { "Package": "ggtree", - "Version": "3.8.2", - "Source": "Bioconductor", + "Version": "3.10.1", + "Source": "Repository", + "Repository": "Bioconductor 3.18", "Remotes": "GuangchuangYu/treeio", "git_url": "https://git.bioconductor.org/packages/ggtree", - "git_branch": "RELEASE_3_17", - "git_last_commit": "36ae5e5", - "git_last_commit_date": "2023-07-24", + "git_branch": "RELEASE_3_18", + "git_last_commit": "5014378", + "git_last_commit_date": "2024-02-25", "Requirements": [ "R", "ape", @@ -693,7 +691,7 @@ "utils", "yulab.utils" ], - "Hash": "8959d04f88a175de3f0cd2b46b4c2a65" + "Hash": "6b825b70c84bd46133ac63b6dccedef0" }, "gh": { "Package": "gh", @@ -723,25 +721,25 @@ }, "globals": { "Package": "globals", - "Version": "0.16.2", + "Version": "0.16.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "codetools" ], - "Hash": "baa9585ab4ce47a9f4618e671778cc6f" + "Hash": "2580567908cafd4f187c1e5a91e98b7f" }, "glue": { "Package": "glue", - "Version": "1.6.2", + "Version": "1.7.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e" + "Hash": "e0b3a53876554bd45879e596cdb10a52" }, "gridGraphics": { "Package": "gridGraphics", @@ -757,9 +755,9 @@ }, "gtable": { "Package": "gtable", - "Version": "0.3.3", + "Version": "0.3.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -768,7 +766,7 @@ "lifecycle", "rlang" ], - "Hash": "b44addadb528a0d227794121c00572a0" + "Hash": "b29cf3031f49b04ab9c852c912547eef" }, "highr": { "Package": "highr", @@ -803,9 +801,9 @@ }, "htmltools": { "Package": "htmltools", - "Version": "0.5.5", + "Version": "0.5.7", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "base64enc", @@ -816,13 +814,13 @@ "rlang", "utils" ], - "Hash": "ba0240784ad50a62165058a27459304a" + "Hash": "2d7b3857980e0e0d0a1fd6f11928ab0f" }, "htmlwidgets": { "Package": "htmlwidgets", - "Version": "1.6.2", + "Version": "1.6.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "grDevices", "htmltools", @@ -831,13 +829,13 @@ "rmarkdown", "yaml" ], - "Hash": "a865aa85bcb2697f47505bfd70422471" + "Hash": "04291cc45198225444a397606810ac37" }, "httpuv": { "Package": "httpuv", - "Version": "1.6.11", + "Version": "1.6.14", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", @@ -846,13 +844,13 @@ "promises", "utils" ], - "Hash": "838602f54e32c1a0f8cc80708cefcefa" + "Hash": "16abeb167dbf511f8cc0552efaf05bab" }, "httr": { "Package": "httr", - "Version": "1.4.6", + "Version": "1.4.7", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", @@ -861,26 +859,28 @@ "mime", "openssl" ], - "Hash": "7e5e3cbd2a7bc07880c94e22348fb661" + "Hash": "ac107251d9d9fd72f0ca8049988f1d7f" }, "httr2": { "Package": "httr2", - "Version": "0.2.3", + "Version": "1.0.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", "cli", "curl", "glue", + "lifecycle", "magrittr", "openssl", "rappdirs", "rlang", + "vctrs", "withr" ], - "Hash": "193bb297368afbbb42dc85784a46b36e" + "Hash": "e2b30f1fc039a0bab047dd52bb20ef71" }, "ini": { "Package": "ini", @@ -940,19 +940,19 @@ }, "jsonlite": { "Package": "jsonlite", - "Version": "1.8.4", + "Version": "1.8.8", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "methods" ], - "Hash": "a4269a09a9b865579b2635c77e572374" + "Hash": "e1b9c55281c5adc4dd113652d9e26768" }, "knitr": { "Package": "knitr", - "Version": "1.43", + "Version": "1.45", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "evaluate", @@ -962,41 +962,33 @@ "xfun", "yaml" ], - "Hash": "9775eb076713f627c07ce41d8199d8f6" + "Hash": "1ec462871063897135c1bcbe0fc8f07d" }, "labeling": { "Package": "labeling", - "Version": "0.4.2", + "Version": "0.4.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "graphics", "stats" ], - "Hash": "3d5108641f47470611a32d0bdf357a72" + "Hash": "b64ec208ac5bc1852b285f665d6368b3" }, "later": { "Package": "later", - "Version": "1.3.0", + "Version": "1.3.2", "Source": "Repository", - "Repository": "RSPM", - "RemotePkgRef": "later@1.3.0", - "RemoteType": "standard", - "RemoteEtag": "\"d88839554a04c066f8ca978670ee8a9d\"", - "RemotePackaged": "TRUE", - "RemoteRef": "later", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "1.3.0", + "Repository": "CRAN", "Requirements": [ "Rcpp", "rlang" ], - "Hash": "7e7b457d7766bc47f2a5f21cc2984f8e" + "Hash": "a3e051d405326b8b0012377434c62b37" }, "lattice": { "Package": "lattice", - "Version": "0.21-8", + "Version": "0.22-5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1007,7 +999,7 @@ "stats", "utils" ], - "Hash": "0b8a6d63c8770f02a8b5635f3c431e6b" + "Hash": "7c5e89f04e72d6611c77451f6331a091" }, "lazyeval": { "Package": "lazyeval", @@ -1021,29 +1013,29 @@ }, "lifecycle": { "Package": "lifecycle", - "Version": "1.0.3", + "Version": "1.0.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", "glue", "rlang" ], - "Hash": "001cecbeac1cff9301bdc3775ee46a86" + "Hash": "b8552d117e1b808b09a832f589b79035" }, "lubridate": { "Package": "lubridate", - "Version": "1.9.2", + "Version": "1.9.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "generics", "methods", "timechange" ], - "Hash": "e25f18436e3efd42c7c590a1c4c15390" + "Hash": "680ad542fbcf801442c83a6ac5a2126c" }, "magrittr": { "Package": "magrittr", @@ -1068,7 +1060,7 @@ }, "mgcv": { "Package": "mgcv", - "Version": "1.8-42", + "Version": "1.9-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1081,7 +1073,7 @@ "stats", "utils" ], - "Hash": "3460beba7ccc8946249ba35327ba902a" + "Hash": "110ee9d83b496279960e162ac97764ce" }, "mime": { "Package": "mime", @@ -1106,7 +1098,7 @@ }, "nlme": { "Package": "nlme", - "Version": "3.1-162", + "Version": "3.1-164", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1116,33 +1108,35 @@ "stats", "utils" ], - "Hash": "0984ce8da8da9ead8643c5cbbb60f83e" + "Hash": "a623a2239e642806158bc4dc3f51565d" }, "openssl": { "Package": "openssl", - "Version": "2.0.6", + "Version": "2.1.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "askpass" ], - "Hash": "0f7cd2962e3044bb940cca4f4b5cecbe" + "Hash": "2a0dc8c6adfb6f032e4d4af82d258ab5" }, "patchwork": { "Package": "patchwork", - "Version": "1.1.2", + "Version": "1.2.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ + "cli", "ggplot2", "grDevices", "graphics", "grid", "gtable", + "rlang", "stats", "utils" ], - "Hash": "63b611e9d909a9ed057639d9c3b77152" + "Hash": "9c8ab14c00ac07e9e04d1664c0b74486" }, "pillar": { "Package": "pillar", @@ -1163,14 +1157,30 @@ }, "pingr": { "Package": "pingr", - "Version": "2.0.2", + "Version": "2.0.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ + "R", "processx", "utils" ], - "Hash": "b762f8f7d305f7eb0bab96eb1a3c782a" + "Hash": "8d2db1d13f4198a00ebf2f066bf2ab67" + }, + "pkgbuild": { + "Package": "pkgbuild", + "Version": "1.4.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "callr", + "cli", + "desc", + "processx" + ], + "Hash": "c0143443203205e6a2760ce553dafc24" }, "pkgconfig": { "Package": "pkgconfig", @@ -1184,9 +1194,9 @@ }, "pkgload": { "Package": "pkgload", - "Version": "1.3.2", + "Version": "1.3.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -1195,12 +1205,45 @@ "fs", "glue", "methods", + "pkgbuild", "rlang", "rprojroot", "utils", "withr" ], - "Hash": "6b0c222c5071efe0f3baf3dae9aa40e2" + "Hash": "876c618df5ae610be84356d5d7a5d124" + }, + "plotly": { + "Package": "plotly", + "Version": "4.10.4", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "RColorBrewer", + "base64enc", + "crosstalk", + "data.table", + "digest", + "dplyr", + "ggplot2", + "htmltools", + "htmlwidgets", + "httr", + "jsonlite", + "lazyeval", + "magrittr", + "promises", + "purrr", + "rlang", + "scales", + "tibble", + "tidyr", + "tools", + "vctrs", + "viridisLite" + ], + "Hash": "a1ac5c03ad5ad12b9d1597e00e23c3dd" }, "praise": { "Package": "praise", @@ -1211,80 +1254,73 @@ }, "prettyunits": { "Package": "prettyunits", - "Version": "1.1.1", + "Version": "1.2.0", "Source": "Repository", - "Repository": "RSPM", - "Hash": "95ef9167b75dde9d2ccc3c7528393e7e" + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "6b01fc98b1e86c4f705ce9dcfd2f57c7" }, "processx": { "Package": "processx", - "Version": "3.8.1", + "Version": "3.8.3", "Source": "Repository", - "Repository": "RSPM", - "RemoteType": "standard", - "RemotePkgRef": "processx", - "RemoteRef": "processx", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "3.8.1", + "Repository": "CRAN", "Requirements": [ "R", "R6", "ps", "utils" ], - "Hash": "d75b4059d781336efba24021915902b4" + "Hash": "82d48b1aec56084d9438dbf98087a7e9" }, "progress": { "Package": "progress", - "Version": "1.2.2", + "Version": "1.2.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ + "R", "R6", "crayon", "hms", "prettyunits" ], - "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061" + "Hash": "f4625e061cb2865f111b47ff163a5ca6" }, "promises": { "Package": "promises", - "Version": "1.2.0.1", + "Version": "1.2.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R6", "Rcpp", + "fastmap", "later", "magrittr", "rlang", "stats" ], - "Hash": "4ab2c43adb4d4699cf3690acd378d75d" + "Hash": "0d8a15c9d000970ada1ab21405387dee" }, "ps": { "Package": "ps", - "Version": "1.7.5", + "Version": "1.7.6", "Source": "Repository", - "Repository": "RSPM", - "RemoteType": "standard", - "RemotePkgRef": "ps", - "RemoteRef": "ps", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "1.7.5", + "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "709d852d33178db54b17c722e5b1e594" + "Hash": "dd2b9319ee0656c8acf45c7f40c59de7" }, "purrr": { "Package": "purrr", - "Version": "1.0.1", + "Version": "1.0.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -1293,7 +1329,7 @@ "rlang", "vctrs" ], - "Hash": "d71c815267c640f17ddbf7f16144b4bb" + "Hash": "1cba04a4e9414bdefc9dcaa99649a8dc" }, "rappdirs": { "Package": "rappdirs", @@ -1307,13 +1343,13 @@ }, "reactR": { "Package": "reactR", - "Version": "0.4.4", + "Version": "0.5.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "htmltools" ], - "Hash": "75389c8091eb14ee21c6bc87a88b3809" + "Hash": "c9014fd1a435b2d790dd506589cb24e5" }, "reactable": { "Package": "reactable", @@ -1332,9 +1368,9 @@ }, "readr": { "Package": "readr", - "Version": "2.1.4", + "Version": "2.1.5", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", @@ -1351,7 +1387,7 @@ "utils", "vroom" ], - "Hash": "b5047343b3825f37ad9d3b5d89aa1078" + "Hash": "9de96463d2117f6ac49980577939dfb3" }, "rematch2": { "Package": "rematch2", @@ -1365,30 +1401,25 @@ }, "renv": { "Package": "renv", - "Version": "0.17.3", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "utils" - ], - "Hash": "4543b8cd233ae25c6aba8548be9e747e" + "Version": "1.0.5", + "Source": "Repository" }, "rlang": { "Package": "rlang", - "Version": "1.1.1", + "Version": "1.1.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "a85c767b55f0bf9b7ad16c6d7baee5bb" + "Hash": "42548638fae05fd9a9b5f3f437fbbbe2" }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.22", + "Version": "2.26", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "bslib", @@ -1399,45 +1430,36 @@ "jsonlite", "knitr", "methods", - "stringr", "tinytex", "tools", "utils", "xfun", "yaml" ], - "Hash": "75a01be060d800ceb14e32c666cacac9" + "Hash": "9b148e7f95d33aac01f31282d49e4f44" }, "rprojroot": { "Package": "rprojroot", - "Version": "2.0.3", + "Version": "2.0.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "1de7ab598047a87bba48434ba35d497d" + "Hash": "4c8415e0ec1e29f3f4f6fc108bef0144" }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.14", + "Version": "0.15.0", "Source": "Repository", - "Repository": "RSPM", - "Hash": "690bd2acc42a9166ce34845884459320" + "Repository": "CRAN", + "Hash": "5564500e25cffad9e22244ced1379887" }, "sass": { "Package": "sass", - "Version": "0.4.5", + "Version": "0.4.8", "Source": "Repository", - "Repository": "RSPM", - "RemotePkgRef": "sass@0.4.5", - "RemoteType": "standard", - "RemoteEtag": "\"3cac281329b169253ec2dc4243739459\"", - "RemotePackaged": "TRUE", - "RemoteRef": "sass", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "0.4.5", + "Repository": "CRAN", "Requirements": [ "R6", "fs", @@ -1445,31 +1467,33 @@ "rappdirs", "rlang" ], - "Hash": "2bb4371a4c80115518261866eab6ab11" + "Hash": "168f9353c76d4c4b0a0bbf72e2c2d035" }, "scales": { "Package": "scales", - "Version": "1.2.1", + "Version": "1.3.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", "RColorBrewer", + "cli", "farver", + "glue", "labeling", "lifecycle", "munsell", "rlang", "viridisLite" ], - "Hash": "906cb23d2f1c5680b8ce439b44c6fa63" + "Hash": "c19df082ba346b0ffa6f833e92de34d1" }, "shiny": { "Package": "shiny", - "Version": "1.7.4", + "Version": "1.8.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", @@ -1497,7 +1521,7 @@ "withr", "xtable" ], - "Hash": "c2eae3d8c670fa9dfa35a12066f4a1d5" + "Hash": "3a1f41807d648a908e3c7f0334bf85e6" }, "shinybrowser": { "Package": "shinybrowser", @@ -1531,9 +1555,9 @@ }, "shinytest2": { "Package": "shinytest2", - "Version": "0.2.1", + "Version": "0.3.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R6", "callr", @@ -1553,25 +1577,19 @@ "testthat", "withr" ], - "Hash": "da29b51211b28a7180977d94b638127e" + "Hash": "04e60b31d4afef1d221ede5fafb0c6f6" }, "snakecase": { "Package": "snakecase", - "Version": "0.11.0", + "Version": "0.11.1", "Source": "Repository", - "Repository": "RSPM", - "RemoteType": "standard", - "RemotePkgRef": "snakecase", - "RemoteRef": "snakecase", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "0.11.0", + "Repository": "CRAN", "Requirements": [ "R", "stringi", "stringr" ], - "Hash": "4079070fc210c7901c0832a3aeab894f" + "Hash": "58767e44739b76965332e8a4fe3f91f1" }, "sourcetools": { "Package": "sourcetools", @@ -1585,28 +1603,22 @@ }, "stringi": { "Package": "stringi", - "Version": "1.7.12", + "Version": "1.8.3", "Source": "Repository", - "Repository": "RSPM", - "RemoteType": "standard", - "RemotePkgRef": "stringi", - "RemoteRef": "stringi", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "1.7.12", + "Repository": "CRAN", "Requirements": [ "R", "stats", "tools", "utils" ], - "Hash": "ca8bd84263c77310739d2cf64d84d7c9" + "Hash": "058aebddea264f4c99401515182e656a" }, "stringr": { "Package": "stringr", - "Version": "1.5.0", + "Version": "1.5.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -1617,7 +1629,7 @@ "stringi", "vctrs" ], - "Hash": "671a4d384ae9d32fc47a14e98bfa3dc8" + "Hash": "960e2ae9e09656611e0b8214ad543207" }, "sys": { "Package": "sys", @@ -1628,20 +1640,20 @@ }, "systemfonts": { "Package": "systemfonts", - "Version": "1.0.4", + "Version": "1.0.6", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cpp11" ], - "Hash": "90b28393209827327de889f49935140a" + "Hash": "6d538cff441f0f1f36db2209ac7495ac" }, "testthat": { "Package": "testthat", - "Version": "3.1.8", + "Version": "3.2.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", @@ -1650,7 +1662,6 @@ "cli", "desc", "digest", - "ellipsis", "evaluate", "jsonlite", "lifecycle", @@ -1665,7 +1676,7 @@ "waldo", "withr" ], - "Hash": "e0eded5dd915510f8e0d6e6277506203" + "Hash": "4767a686ebe986e6cb01d075b3f09729" }, "tibble": { "Package": "tibble", @@ -1688,9 +1699,9 @@ }, "tidyr": { "Package": "tidyr", - "Version": "1.3.0", + "Version": "1.3.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -1707,13 +1718,13 @@ "utils", "vctrs" ], - "Hash": "e47debdc7ce599b070c8e78e8ac0cfcf" + "Hash": "915fb7ce036c22a6a33b5a8adb712eb1" }, "tidyselect": { "Package": "tidyselect", - "Version": "1.2.0", + "Version": "1.2.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -1723,13 +1734,13 @@ "vctrs", "withr" ], - "Hash": "79540e5fcd9e0435af547d885f184fd5" + "Hash": "829f27b9c4919c16b593794a6344d6c0" }, "tidytree": { "Package": "tidytree", - "Version": "0.4.2", + "Version": "0.4.6", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "ape", @@ -1745,51 +1756,51 @@ "tidyselect", "yulab.utils" ], - "Hash": "6f2eb34d95db945d4dd022b0811e28db" + "Hash": "a700d295c0eff82fbce42eac067bb89d" }, "timechange": { "Package": "timechange", - "Version": "0.2.0", + "Version": "0.3.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cpp11" ], - "Hash": "8548b44f79a35ba1791308b61e6012d7" + "Hash": "c5f3c201b931cd6474d17d8700ccb1c8" }, "tinytex": { "Package": "tinytex", - "Version": "0.45", + "Version": "0.49", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "xfun" ], - "Hash": "e4e357f28c2edff493936b6cb30c3d65" + "Hash": "5ac22900ae0f386e54f1c307eca7d843" }, "treeio": { "Package": "treeio", - "Version": "1.24.3", + "Version": "1.26.0", "Source": "Bioconductor", "git_url": "https://git.bioconductor.org/packages/treeio", - "git_branch": "RELEASE_3_17", - "git_last_commit": "132fb4d", - "git_last_commit_date": "2023-07-24", + "git_branch": "RELEASE_3_18", + "git_last_commit": "cce8f0a", + "git_last_commit_date": "2023-10-24", "Requirements": [ "R", "ape", - "cli", "dplyr", "jsonlite", "magrittr", "methods", "rlang", + "stats", "tibble", "tidytree", "utils" ], - "Hash": "c8c8efbcec2f1512d6079af62b0f112b" + "Hash": "a09203806aa0bc49965563ca7016620e" }, "tzdb": { "Package": "tzdb", @@ -1804,9 +1815,9 @@ }, "usethis": { "Package": "usethis", - "Version": "2.1.6", + "Version": "2.2.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -1831,39 +1842,33 @@ "withr", "yaml" ], - "Hash": "a67a22c201832b12c036cc059f1d137d" + "Hash": "d524fd42c517035027f866064417d7e6" }, "utf8": { "Package": "utf8", - "Version": "1.2.3", + "Version": "1.2.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "1fe17157424bb09c48a8b3b550c753bc" + "Hash": "62b65c52671e6665f803ff02954446e9" }, "uuid": { "Package": "uuid", - "Version": "1.1-0", + "Version": "1.2-0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "f1cb46c157d080b729159d407be83496" + "Hash": "303c19bfd970bece872f93a824e323d9" }, "vctrs": { "Package": "vctrs", - "Version": "0.6.2", + "Version": "0.6.5", "Source": "Repository", - "Repository": "RSPM", - "RemoteType": "standard", - "RemotePkgRef": "vctrs", - "RemoteRef": "vctrs", - "RemoteRepos": "https://packagemanager.rstudio.com/all/latest", - "RemotePkgPlatform": "source", - "RemoteSha": "0.6.2", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -1871,7 +1876,7 @@ "lifecycle", "rlang" ], - "Hash": "a745bda7aff4734c17294bb41d4e4607" + "Hash": "c03fa420630029418f7e6da3667aac4a" }, "viridisLite": { "Package": "viridisLite", @@ -1885,9 +1890,9 @@ }, "vroom": { "Package": "vroom", - "Version": "1.6.3", + "Version": "1.6.5", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "bit64", @@ -1907,14 +1912,15 @@ "vctrs", "withr" ], - "Hash": "8318e64ffb3a70e652494017ec455561" + "Hash": "390f9315bc0025be03012054103d227c" }, "waldo": { "Package": "waldo", - "Version": "0.5.1", + "Version": "0.5.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ + "R", "cli", "diffobj", "fansi", @@ -1924,7 +1930,7 @@ "rlang", "tibble" ], - "Hash": "2c993415154cdb94649d99ae138ff5e5" + "Hash": "c7d3fd6d29ab077cbac8f0e2751449e6" }, "websocket": { "Package": "websocket", @@ -1948,27 +1954,27 @@ }, "withr": { "Package": "withr", - "Version": "2.5.0", + "Version": "3.0.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "grDevices", - "graphics", - "stats" + "graphics" ], - "Hash": "c0e49a9760983e81e55cdd9be92e7182" + "Hash": "d31b6c62c10dcf11ec530ca6b0dd5d35" }, "xfun": { "Package": "xfun", - "Version": "0.39", + "Version": "0.42", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ + "grDevices", "stats", "tools" ], - "Hash": "8f56e9acb54fb525e66464d57ab58bcb" + "Hash": "fd1349170df31f7a10bd98b0189e85af" }, "xtable": { "Package": "xtable", @@ -1984,28 +1990,34 @@ }, "yaml": { "Package": "yaml", - "Version": "2.3.7", + "Version": "2.3.8", "Source": "Repository", - "Repository": "RSPM", - "Hash": "0d0056cc5383fbc240ccd0cb584bf436" + "Repository": "CRAN", + "Hash": "29240487a071f535f5e5d5a323b7afbd" }, "yulab.utils": { "Package": "yulab.utils", - "Version": "0.0.6", + "Version": "0.1.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ + "cli", + "digest", + "fs", + "memoise", + "rlang", "stats", + "tools", "utils" ], - "Hash": "0d0b7cc6da5efc21f07f6b8d966a9cc1" + "Hash": "60ee2aaa179dc282e9fa7367bad76e89" }, "zip": { "Package": "zip", - "Version": "2.3.0", + "Version": "2.3.1", "Source": "Repository", - "Repository": "RSPM", - "Hash": "d98c94dacb7e0efcf83b0a133a705504" + "Repository": "CRAN", + "Hash": "fcc4bd8e6da2d2011eb64a5e5cc685ab" } } } diff --git a/renv/activate.R b/renv/activate.R index a8fdc320..9b2e7f18 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,11 +2,27 @@ local({ # the requested version of renv - version <- "0.17.3" + version <- "1.0.5" + attr(version, "sha") <- NULL # the project directory project <- getwd() + # use start-up diagnostics if enabled + diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE") + if (diagnostics) { + start <- Sys.time() + profile <- tempfile("renv-startup-", fileext = ".Rprof") + utils::Rprof(profile) + on.exit({ + utils::Rprof(NULL) + elapsed <- signif(difftime(Sys.time(), start, units = "auto"), digits = 2L) + writeLines(sprintf("- renv took %s to run the autoloader.", format(elapsed))) + writeLines(sprintf("- Profile: %s", profile)) + print(utils::summaryRprof(profile)) + }, add = TRUE) + } + # figure out whether the autoloader is enabled enabled <- local({ @@ -15,6 +31,14 @@ local({ if (!is.null(override)) return(override) + # if we're being run in a context where R_LIBS is already set, + # don't load -- presumably we're being run as a sub-process and + # the parent process has already set up library paths for us + rcmd <- Sys.getenv("R_CMD", unset = NA) + rlibs <- Sys.getenv("R_LIBS", unset = NA) + if (!is.na(rlibs) && !is.na(rcmd)) + return(FALSE) + # next, check environment variables # TODO: prefer using the configuration one in the future envvars <- c( @@ -34,9 +58,22 @@ local({ }) - if (!enabled) + # bail if we're not enabled + if (!enabled) { + + # if we're not enabled, we might still need to manually load + # the user profile here + profile <- Sys.getenv("R_PROFILE_USER", unset = "~/.Rprofile") + if (file.exists(profile)) { + cfg <- Sys.getenv("RENV_CONFIG_USER_PROFILE", unset = "TRUE") + if (tolower(cfg) %in% c("true", "t", "1")) + sys.source(profile, envir = globalenv()) + } + return(FALSE) + } + # avoid recursion if (identical(getOption("renv.autoloader.running"), TRUE)) { warning("ignoring recursive attempt to run renv autoloader") @@ -60,25 +97,75 @@ local({ # load bootstrap tools `%||%` <- function(x, y) { - if (is.environment(x) || length(x)) x else y + if (is.null(x)) y else x } - `%??%` <- function(x, y) { - if (is.null(x)) y else x + catf <- function(fmt, ..., appendLF = TRUE) { + + quiet <- getOption("renv.bootstrap.quiet", default = FALSE) + if (quiet) + return(invisible()) + + msg <- sprintf(fmt, ...) + cat(msg, file = stdout(), sep = if (appendLF) "\n" else "") + + invisible(msg) + + } + + header <- function(label, + ..., + prefix = "#", + suffix = "-", + n = min(getOption("width"), 78)) + { + label <- sprintf(label, ...) + n <- max(n - nchar(label) - nchar(prefix) - 2L, 8L) + if (n <= 0) + return(paste(prefix, label)) + + tail <- paste(rep.int(suffix, n), collapse = "") + paste0(prefix, " ", label, " ", tail) + + } + + startswith <- function(string, prefix) { + substring(string, 1, nchar(prefix)) == prefix } bootstrap <- function(version, library) { + friendly <- renv_bootstrap_version_friendly(version) + section <- header(sprintf("Bootstrapping renv %s", friendly)) + catf(section) + # attempt to download renv - tarball <- tryCatch(renv_bootstrap_download(version), error = identity) - if (inherits(tarball, "error")) - stop("failed to download renv ", version) + catf("- Downloading renv ... ", appendLF = FALSE) + withCallingHandlers( + tarball <- renv_bootstrap_download(version), + error = function(err) { + catf("FAILED") + stop("failed to download:\n", conditionMessage(err)) + } + ) + catf("OK") + on.exit(unlink(tarball), add = TRUE) # now attempt to install - status <- tryCatch(renv_bootstrap_install(version, tarball, library), error = identity) - if (inherits(status, "error")) - stop("failed to install renv ", version) + catf("- Installing renv ... ", appendLF = FALSE) + withCallingHandlers( + status <- renv_bootstrap_install(version, tarball, library), + error = function(err) { + catf("FAILED") + stop("failed to install:\n", conditionMessage(err)) + } + ) + catf("OK") + + # add empty line to break up bootstrapping from normal output + catf("") + return(invisible()) } renv_bootstrap_tests_running <- function() { @@ -108,13 +195,6 @@ local({ if (!inherits(repos, "error") && length(repos)) return(repos) - # if we're testing, re-use the test repositories - if (renv_bootstrap_tests_running()) { - repos <- getOption("renv.tests.repos") - if (!is.null(repos)) - return(repos) - } - # retrieve current repos repos <- getOption("repos") @@ -158,33 +238,34 @@ local({ renv_bootstrap_download <- function(version) { - # if the renv version number has 4 components, assume it must - # be retrieved via github - nv <- numeric_version(version) - components <- unclass(nv)[[1]] - - # if this appears to be a development version of 'renv', we'll - # try to restore from github - dev <- length(components) == 4L - - # begin collecting different methods for finding renv - methods <- c( - renv_bootstrap_download_tarball, - if (dev) - renv_bootstrap_download_github - else c( - renv_bootstrap_download_cran_latest, - renv_bootstrap_download_cran_archive + sha <- attr(version, "sha", exact = TRUE) + + methods <- if (!is.null(sha)) { + + # attempting to bootstrap a development version of renv + c( + function() renv_bootstrap_download_tarball(sha), + function() renv_bootstrap_download_github(sha) ) - ) + + } else { + + # attempting to bootstrap a release version of renv + c( + function() renv_bootstrap_download_tarball(version), + function() renv_bootstrap_download_cran_latest(version), + function() renv_bootstrap_download_cran_archive(version) + ) + + } for (method in methods) { - path <- tryCatch(method(version), error = identity) + path <- tryCatch(method(), error = identity) if (is.character(path) && file.exists(path)) return(path) } - stop("failed to download renv ", version) + stop("All download methods failed") } @@ -248,8 +329,6 @@ local({ type <- spec$type repos <- spec$repos - message("* Downloading renv ", version, " ... ", appendLF = FALSE) - baseurl <- utils::contrib.url(repos = repos, type = type) ext <- if (identical(type, "source")) ".tar.gz" @@ -266,13 +345,10 @@ local({ condition = identity ) - if (inherits(status, "condition")) { - message("FAILED") + if (inherits(status, "condition")) return(FALSE) - } # report success and return - message("OK (downloaded ", type, ")") destfile } @@ -329,8 +405,6 @@ local({ urls <- file.path(repos, "src/contrib/Archive/renv", name) destfile <- file.path(tempdir(), name) - message("* Downloading renv ", version, " ... ", appendLF = FALSE) - for (url in urls) { status <- tryCatch( @@ -338,14 +412,11 @@ local({ condition = identity ) - if (identical(status, 0L)) { - message("OK") + if (identical(status, 0L)) return(destfile) - } } - message("FAILED") return(FALSE) } @@ -368,7 +439,7 @@ local({ if (!file.exists(tarball)) { # let the user know we weren't able to honour their request - fmt <- "* RENV_BOOTSTRAP_TARBALL is set (%s) but does not exist." + fmt <- "- RENV_BOOTSTRAP_TARBALL is set (%s) but does not exist." msg <- sprintf(fmt, tarball) warning(msg) @@ -377,10 +448,7 @@ local({ } - fmt <- "* Bootstrapping with tarball at path '%s'." - msg <- sprintf(fmt, tarball) - message(msg) - + catf("- Using local tarball '%s'.", tarball) tarball } @@ -407,8 +475,6 @@ local({ on.exit(do.call(base::options, saved), add = TRUE) } - message("* Downloading renv ", version, " from GitHub ... ", appendLF = FALSE) - url <- file.path("https://api.github.com/repos/rstudio/renv/tarball", version) name <- sprintf("renv_%s.tar.gz", version) destfile <- file.path(tempdir(), name) @@ -418,26 +484,105 @@ local({ condition = identity ) - if (!identical(status, 0L)) { - message("FAILED") + if (!identical(status, 0L)) return(FALSE) - } - message("OK") + renv_bootstrap_download_augment(destfile) + return(destfile) } + # Add Sha to DESCRIPTION. This is stop gap until #890, after which we + # can use renv::install() to fully capture metadata. + renv_bootstrap_download_augment <- function(destfile) { + sha <- renv_bootstrap_git_extract_sha1_tar(destfile) + if (is.null(sha)) { + return() + } + + # Untar + tempdir <- tempfile("renv-github-") + on.exit(unlink(tempdir, recursive = TRUE), add = TRUE) + untar(destfile, exdir = tempdir) + pkgdir <- dir(tempdir, full.names = TRUE)[[1]] + + # Modify description + desc_path <- file.path(pkgdir, "DESCRIPTION") + desc_lines <- readLines(desc_path) + remotes_fields <- c( + "RemoteType: github", + "RemoteHost: api.github.com", + "RemoteRepo: renv", + "RemoteUsername: rstudio", + "RemotePkgRef: rstudio/renv", + paste("RemoteRef: ", sha), + paste("RemoteSha: ", sha) + ) + writeLines(c(desc_lines[desc_lines != ""], remotes_fields), con = desc_path) + + # Re-tar + local({ + old <- setwd(tempdir) + on.exit(setwd(old), add = TRUE) + + tar(destfile, compression = "gzip") + }) + invisible() + } + + # Extract the commit hash from a git archive. Git archives include the SHA1 + # hash as the comment field of the tarball pax extended header + # (see https://www.kernel.org/pub/software/scm/git/docs/git-archive.html) + # For GitHub archives this should be the first header after the default one + # (512 byte) header. + renv_bootstrap_git_extract_sha1_tar <- function(bundle) { + + # open the bundle for reading + # We use gzcon for everything because (from ?gzcon) + # > Reading from a connection which does not supply a 'gzip' magic + # > header is equivalent to reading from the original connection + conn <- gzcon(file(bundle, open = "rb", raw = TRUE)) + on.exit(close(conn)) + + # The default pax header is 512 bytes long and the first pax extended header + # with the comment should be 51 bytes long + # `52 comment=` (11 chars) + 40 byte SHA1 hash + len <- 0x200 + 0x33 + res <- rawToChar(readBin(conn, "raw", n = len)[0x201:len]) + + if (grepl("^52 comment=", res)) { + sub("52 comment=", "", res) + } else { + NULL + } + } + renv_bootstrap_install <- function(version, tarball, library) { # attempt to install it into project library - message("* Installing renv ", version, " ... ", appendLF = FALSE) dir.create(library, showWarnings = FALSE, recursive = TRUE) + output <- renv_bootstrap_install_impl(library, tarball) + + # check for successful install + status <- attr(output, "status") + if (is.null(status) || identical(status, 0L)) + return(status) + + # an error occurred; report it + header <- "installation of renv failed" + lines <- paste(rep.int("=", nchar(header)), collapse = "") + text <- paste(c(header, lines, output), collapse = "\n") + stop(text) + + } + + renv_bootstrap_install_impl <- function(library, tarball) { # invoke using system2 so we can capture and report output bin <- R.home("bin") exe <- if (Sys.info()[["sysname"]] == "Windows") "R.exe" else "R" - r <- file.path(bin, exe) + R <- file.path(bin, exe) args <- c( "--vanilla", "CMD", "INSTALL", "--no-multiarch", @@ -445,19 +590,7 @@ local({ shQuote(path.expand(tarball)) ) - output <- system2(r, args, stdout = TRUE, stderr = TRUE) - message("Done!") - - # check for successful install - status <- attr(output, "status") - if (is.numeric(status) && !identical(status, 0L)) { - header <- "Error installing renv:" - lines <- paste(rep.int("=", nchar(header)), collapse = "") - text <- c(header, lines, output) - writeLines(text, con = stderr()) - } - - status + system2(R, args, stdout = TRUE, stderr = TRUE) } @@ -667,34 +800,62 @@ local({ } - renv_bootstrap_validate_version <- function(version) { + renv_bootstrap_validate_version <- function(version, description = NULL) { - loadedversion <- utils::packageDescription("renv", fields = "Version") - if (version == loadedversion) - return(TRUE) + # resolve description file + # + # avoid passing lib.loc to `packageDescription()` below, since R will + # use the loaded version of the package by default anyhow. note that + # this function should only be called after 'renv' is loaded + # https://github.com/rstudio/renv/issues/1625 + description <- description %||% packageDescription("renv") - # assume four-component versions are from GitHub; - # three-component versions are from CRAN - components <- strsplit(loadedversion, "[.-]")[[1]] - remote <- if (length(components) == 4L) - paste("rstudio/renv", loadedversion, sep = "@") + # check whether requested version 'version' matches loaded version of renv + sha <- attr(version, "sha", exact = TRUE) + valid <- if (!is.null(sha)) + renv_bootstrap_validate_version_dev(sha, description) else - paste("renv", loadedversion, sep = "@") + renv_bootstrap_validate_version_release(version, description) + + if (valid) + return(TRUE) + + # the loaded version of renv doesn't match the requested version; + # give the user instructions on how to proceed + remote <- if (!is.null(description[["RemoteSha"]])) { + paste("rstudio/renv", description[["RemoteSha"]], sep = "@") + } else { + paste("renv", description[["Version"]], sep = "@") + } + + # display both loaded version + sha if available + friendly <- renv_bootstrap_version_friendly( + version = description[["Version"]], + sha = description[["RemoteSha"]] + ) fmt <- paste( "renv %1$s was loaded from project library, but this project is configured to use renv %2$s.", - "Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.", - "Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.", + "- Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.", + "- Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.", sep = "\n" ) - - msg <- sprintf(fmt, loadedversion, version, remote) - warning(msg, call. = FALSE) + catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote) FALSE } + renv_bootstrap_validate_version_dev <- function(version, description) { + expected <- description[["RemoteSha"]] + is.character(expected) && startswith(expected, version) + } + + renv_bootstrap_validate_version_release <- function(version, description) { + expected <- description[["Version"]] + is.character(expected) && identical(expected, version) + } + renv_bootstrap_hash_text <- function(text) { hashfile <- tempfile("renv-hash-") @@ -718,7 +879,7 @@ local({ hooks <- getHook("renv::autoload") for (hook in hooks) if (is.function(hook)) - tryCatch(hook(), error = warning) + tryCatch(hook(), error = warnify) # load the project renv::load(project) @@ -859,6 +1020,40 @@ local({ } + renv_bootstrap_version_friendly <- function(version, shafmt = NULL, sha = NULL) { + sha <- sha %||% attr(version, "sha", exact = TRUE) + parts <- c(version, sprintf(shafmt %||% " [sha: %s]", substring(sha, 1L, 7L))) + paste(parts, collapse = "") + } + + renv_bootstrap_exec <- function(project, libpath, version) { + if (!renv_bootstrap_load(project, libpath, version)) + renv_bootstrap_run(version, libpath) + } + + renv_bootstrap_run <- function(version, libpath) { + + # perform bootstrap + bootstrap(version, libpath) + + # exit early if we're just testing bootstrap + if (!is.na(Sys.getenv("RENV_BOOTSTRAP_INSTALL_ONLY", unset = NA))) + return(TRUE) + + # try again to load + if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) { + return(renv::load(project = getwd())) + } + + # failed to download or load renv; warn the user + msg <- c( + "Failed to find an renv installation: the project will not be loaded.", + "Use `renv::activate()` to re-initialize the project." + ) + + warning(paste(msg, collapse = "\n"), call. = FALSE) + + } renv_json_read <- function(file = NULL, text = NULL) { @@ -867,7 +1062,7 @@ local({ # if jsonlite is loaded, use that instead if ("jsonlite" %in% loadedNamespaces()) { - json <- catch(renv_json_read_jsonlite(file, text)) + json <- tryCatch(renv_json_read_jsonlite(file, text), error = identity) if (!inherits(json, "error")) return(json) @@ -876,7 +1071,7 @@ local({ } # otherwise, fall back to the default JSON reader - json <- catch(renv_json_read_default(file, text)) + json <- tryCatch(renv_json_read_default(file, text), error = identity) if (!inherits(json, "error")) return(json) @@ -889,14 +1084,14 @@ local({ } renv_json_read_jsonlite <- function(file = NULL, text = NULL) { - text <- paste(text %||% read(file), collapse = "\n") + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") jsonlite::fromJSON(txt = text, simplifyVector = FALSE) } renv_json_read_default <- function(file = NULL, text = NULL) { # find strings in the JSON - text <- paste(text %||% read(file), collapse = "\n") + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") pattern <- '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' locs <- gregexpr(pattern, text, perl = TRUE)[[1]] @@ -944,14 +1139,14 @@ local({ map <- as.list(map) # remap strings in object - remapped <- renv_json_remap(json, map) + remapped <- renv_json_read_remap(json, map) # evaluate eval(remapped, envir = baseenv()) } - renv_json_remap <- function(json, map) { + renv_json_read_remap <- function(json, map) { # fix names if (!is.null(names(json))) { @@ -978,7 +1173,7 @@ local({ # recurse if (is.recursive(json)) { for (i in seq_along(json)) { - json[i] <- list(renv_json_remap(json[[i]], map)) + json[i] <- list(renv_json_read_remap(json[[i]], map)) } } @@ -998,35 +1193,9 @@ local({ # construct full libpath libpath <- file.path(root, prefix) - # attempt to load - if (renv_bootstrap_load(project, libpath, version)) - return(TRUE) - - # load failed; inform user we're about to bootstrap - prefix <- paste("# Bootstrapping renv", version) - postfix <- paste(rep.int("-", 77L - nchar(prefix)), collapse = "") - header <- paste(prefix, postfix) - message(header) - - # perform bootstrap - bootstrap(version, libpath) - - # exit early if we're just testing bootstrap - if (!is.na(Sys.getenv("RENV_BOOTSTRAP_INSTALL_ONLY", unset = NA))) - return(TRUE) - - # try again to load - if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) { - message("* Successfully installed and loaded renv ", version, ".") - return(renv::load()) - } - - # failed to download or load renv; warn the user - msg <- c( - "Failed to find an renv installation: the project will not be loaded.", - "Use `renv::activate()` to re-initialize the project." - ) + # run bootstrap code + renv_bootstrap_exec(project, libpath, version) - warning(paste(msg, collapse = "\n"), call. = FALSE) + invisible() }) diff --git a/renv/settings.json b/renv/settings.json new file mode 100644 index 00000000..a3f6796f --- /dev/null +++ b/renv/settings.json @@ -0,0 +1,17 @@ +{ + "bioconductor.version": "3.18", + "external.libraries": [], + "ignored.packages": [], + "package.dependency.fields": [ + "Imports", + "Depends", + "LinkingTo" + ], + "r.version": null, + "snapshot.type": "implicit", + "use.cache": true, + "vcs.ignore.cellar": true, + "vcs.ignore.library": true, + "vcs.ignore.local": true, + "vcs.manage.ignores": true +} diff --git a/tests/testthat/test-shinytest2.R b/tests/testthat/test-shinytest2.R index 373c5b83..c9d436dd 100644 --- a/tests/testthat/test-shinytest2.R +++ b/tests/testthat/test-shinytest2.R @@ -2,7 +2,8 @@ test_that("tfpbrowser app initial values are consistent", { if (interactive()) { shiny_app = tfpbrowser::run_app() app = shinytest2::AppDriver$new(shiny_app, - name = "tfpbrowser") + name = "tfpbrowser" + ) navbar_tab_items = app$get_text(".nav-item") observed_navbar_tab_items = stringr::str_squish(navbar_tab_items) expected_navbar_tab_items = c("Data", "About", "Tables", "Plots", "RDS Files")