diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 7c18f050..4793f47d 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -19,7 +19,6 @@ jobs: matrix: config: - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} diff --git a/DESCRIPTION b/DESCRIPTION index 5e180054..ef85f615 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -12,35 +12,35 @@ Description: A tool to analyse 'ActiGraph' accelerometer data and to implement License: GPL (>= 3) Imports: assertthat, - dbplyr (>= 2.1.1), - dplyr (>= 1.1.0), - flextable (>= 0.8.2), - forcats (>= 0.5.2), - ggplot2 (>= 3.4.0), - golem (>= 0.3.4), - hms (>= 1.1.2), - lubridate (>= 1.8.0), - magrittr (>= 2.0.3), - modelr (>= 0.1.9), - patchwork (>= 1.1.2), + dbplyr, + dplyr, + flextable, + forcats, + ggplot2, + golem, + hms, + lubridate, + magrittr, + modelr, + patchwork, PhysicalActivity, - plyr (>= 1.8.7), - reactable (>= 0.3.0), - rmarkdown (>= 2.16), + plyr, + reactable, + rmarkdown, RSQLite, - shiny (>= 1.7.2), - shinycssloaders (>= 1.0.0), - shinydashboard (>= 0.7.2), - shinydashboardPlus (>= 2.0.3), - shinyFeedback (>= 0.4.0), - shinyjs (>= 2.1.0), - stringr (>= 1.4.1), - tidyr (>= 1.2.1), + shiny, + shinycssloaders, + shinydashboard, + shinydashboardPlus, + shinyFeedback, + shinyjs, + stringr, + tidyr, zoo Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 URL: https://pydemull.github.io/activAnalyzer/, https://github.com/pydemull/activAnalyzer BugReports: https://github.com/pydemull/activAnalyzer/issues Suggests: diff --git a/R/app_server.R b/R/app_server.R index 36d4490a..f379a915 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -1517,7 +1517,7 @@ app_server <- function(input, output, session) { period_info_12$corr_mets() >= 0, period_info_13$corr_mets() >= 0, period_info_14$corr_mets() >= 0, - period_info_15$corr_mets() >= 0, + period_info_15$corr_mets() >= 0 ) @@ -1654,7 +1654,7 @@ app_server <- function(input, output, session) { # Thanks to https://stackoverflow.com/questions/29661269/increment-by-1-for-every-change-in-column # for the code block below df_with_computed_metrics$intensity_category <- as.factor(df_with_computed_metrics$intensity_category) - df_with_computed_metrics$intensity_category_num <- as.numeric(as.character(forcats::fct_recode(df_with_computed_metrics$intensity_category , "0" = "Nonwear", "1" = "SED", "2" = "LPA", "3" = "MVPA"))) + df_with_computed_metrics$intensity_category_num <- as.numeric(as.character(forcats::fct_recode(df_with_computed_metrics$intensity_category, "0" = "Nonwear", "1" = "SED", "2" = "LPA", "3" = "MVPA"))) df_with_computed_metrics$bout <- cumsum(c(1, as.numeric(diff(df_with_computed_metrics$intensity_category_num))!= 0)) } @@ -2010,15 +2010,13 @@ app_server <- function(input, output, session) { output$int_dist_analysis_fig1 <- renderPlot({ results_list()$results_by_day$p_band - }, width = "auto", height = function(){round(nlevels(as.factor(results_list()$df_with_computed_metrics$date))/3, 0) * 370} - , res = 100) + }, width = "auto", height = function(){round(nlevels(as.factor(results_list()$df_with_computed_metrics$date))/3, 0) * 370}, res = 100) # Plotting intensity distribution analysis (2) output$int_dist_analysis_fig1bis <- renderPlot({ results_list()$results_by_day$p_log - }, width = "auto", height = function(){round(nlevels(as.factor(results_list()$df_with_computed_metrics$date))/3, 0) * 370} - , res = 100) + }, width = "auto", height = function(){round(nlevels(as.factor(results_list()$df_with_computed_metrics$date))/3, 0) * 370}, res = 100) # Showing results summarized over valid days in a table (means) output$results_summary_int_dist_means <- reactable::renderReactable({ diff --git a/R/globals.R b/R/globals.R index 57ce9ad3..6a9d3dfe 100644 --- a/R/globals.R +++ b/R/globals.R @@ -133,5 +133,6 @@ utils::globalVariables(c( "bin_label", "lm", "days", - "." + ".", + ".x" )) diff --git a/renv.lock b/renv.lock index 00f2d2f2..0cfa4f08 100644 --- a/renv.lock +++ b/renv.lock @@ -1,6 +1,6 @@ { "R": { - "Version": "4.3.2", + "Version": "4.4.1", "Repositories": [ { "Name": "CRAN", @@ -11,18 +11,18 @@ "Packages": { "DBI": { "Package": "DBI", - "Version": "1.2.2", + "Version": "1.2.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "164809cd72e1d5160b4cb3aa57f510fe" + "Hash": "065ae649b05f1ff66bb0c793107508f5" }, "MASS": { "Package": "MASS", - "Version": "7.3-60", + "Version": "7.3-61", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -33,13 +33,13 @@ "stats", "utils" ], - "Hash": "a56a6365b3fa73293ea8d084be0d9bb0" + "Hash": "0cafd6f0500e5deba33be22c46bf6055" }, "Matrix": { "Package": "Matrix", - "Version": "1.6-1.1", + "Version": "1.7-0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "grDevices", @@ -50,7 +50,7 @@ "stats", "utils" ], - "Hash": "1a00d4828f33a9d690806e98bd17150c" + "Hash": "1920b2f11133b12350024297d8a4ff4a" }, "PhysicalActivity": { "Package": "PhysicalActivity", @@ -66,7 +66,7 @@ "Package": "R6", "Version": "2.5.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R" ], @@ -84,7 +84,7 @@ }, "RSQLite": { "Package": "RSQLite", - "Version": "2.3.6", + "Version": "2.3.7", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -99,24 +99,24 @@ "plogr", "rlang" ], - "Hash": "ae4a925e0f6bb1b7e5fa96b739c5221a" + "Hash": "46b45a4dd7bb0e0f4e3fc22245817240" }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.11", + "Version": "1.0.13", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "methods", "utils" ], - "Hash": "ae6cbbe1492f4de79c45fce06f967ce8" + "Hash": "f27411eb6d9c3dada5edd444b8416675" }, "askpass": { "Package": "askpass", "Version": "1.2.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "sys" ], @@ -144,19 +144,19 @@ }, "backports": { "Package": "backports", - "Version": "1.4.1", + "Version": "1.5.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "c39fbec8a30d23e721980b8afb31984c" + "Hash": "e1e1b9d75c37401117b636b7ae50827a" }, "base64enc": { "Package": "base64enc", "Version": "0.1-3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R" ], @@ -164,13 +164,13 @@ }, "bit": { "Package": "bit", - "Version": "4.0.5", + "Version": "4.5.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "d242abec29412ce988848d0294b208fd" + "Hash": "5dc7b2677d65d0e874fc4aaf0e879987" }, "bit64": { "Package": "bit64", @@ -200,14 +200,13 @@ }, "broom": { "Package": "broom", - "Version": "1.0.5", + "Version": "1.0.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "backports", "dplyr", - "ellipsis", "generics", "glue", "lifecycle", @@ -217,17 +216,18 @@ "tibble", "tidyr" ], - "Hash": "fd25391c3c4f6ecf0fa95f1e6d15378c" + "Hash": "a4652c36d1f8abfc3ddf4774f768c934" }, "bslib": { "Package": "bslib", - "Version": "0.6.1", + "Version": "0.8.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "base64enc", "cachem", + "fastmap", "grDevices", "htmltools", "jquerylib", @@ -238,33 +238,33 @@ "rlang", "sass" ], - "Hash": "c0d8599494bc7fb408cd206bbdd9cab0" + "Hash": "b299c6741ca9746fb227debcb0f9fb6c" }, "cachem": { "Package": "cachem", - "Version": "1.0.8", + "Version": "1.1.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "fastmap", "rlang" ], - "Hash": "c35768291560ce302c0a6589f92e837d" + "Hash": "cd9a672193789068eb5a2aad65a0dedf" }, "cli": { "Package": "cli", - "Version": "3.6.2", + "Version": "3.6.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "1216ac65ac55ec0058a6f75d7ca0fd52" + "Hash": "b21916dd77a27642b447374a5d30ecf3" }, "colorspace": { "Package": "colorspace", - "Version": "2.1-0", + "Version": "2.1-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -274,14 +274,14 @@ "methods", "stats" ], - "Hash": "f20c47fd52fae58b4e377c37bb8c335b" + "Hash": "d954cb1c57e8d8b756165d7ba18aa55a" }, "commonmark": { "Package": "commonmark", - "Version": "1.9.0", + "Version": "1.9.1", "Source": "Repository", - "Repository": "RSPM", - "Hash": "d691c61bff84bd63c383874d2d0c3307" + "Repository": "CRAN", + "Hash": "5d8225445acb167abf7797de48b2ee3c" }, "config": { "Package": "config", @@ -295,61 +295,36 @@ }, "cpp11": { "Package": "cpp11", - "Version": "0.4.7", + "Version": "0.5.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "5a295d7d963cc5035284dcdbaf334f4e" + "Hash": "91570bba75d0c9d3f1040c835cee8fba" }, "crayon": { "Package": "crayon", - "Version": "1.5.2", + "Version": "1.5.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "grDevices", "methods", "utils" ], - "Hash": "e8a1e41acf02548751f45c718d55aa6a" - }, - "crul": { - "Package": "crul", - "Version": "1.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R6", - "curl", - "httpcode", - "jsonlite", - "mime", - "urltools" - ], - "Hash": "1eb00a531331c91d970f3af74b75321f" - }, - "curl": { - "Package": "curl", - "Version": "5.2.1", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R" - ], - "Hash": "411ca2c03b1ce5f548345d2fc2685f7a" + "Hash": "859d96e65ef198fd43e82b9628d593ef" }, "data.table": { "Package": "data.table", - "Version": "1.14.10", + "Version": "1.16.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "6ea17a32294d8ca00455825ab0cf71b9" + "Hash": "fb24e05d4a91d8b1c7ff8e284bde834a" }, "dbplyr": { "Package": "dbplyr", @@ -381,14 +356,14 @@ }, "digest": { "Package": "digest", - "Version": "0.6.33", + "Version": "0.6.37", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "b18a9cf3c003977b0cc49d5e76ebe48d" + "Hash": "33698c4b3127fc9f506654607fb73676" }, "dplyr": { "Package": "dplyr", @@ -413,27 +388,15 @@ ], "Hash": "fedd9d00c2944ff00a0e2696ccf048ec" }, - "ellipsis": { - "Package": "ellipsis", - "Version": "0.3.2", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "rlang" - ], - "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077" - }, "evaluate": { "Package": "evaluate", - "Version": "0.23", + "Version": "1.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ - "R", - "methods" + "R" ], - "Hash": "daf4a1246be12c1fa8c7705a0935c1a0" + "Hash": "6b567375113ceb7d9f800de4dd42218e" }, "fansi": { "Package": "fansi", @@ -449,21 +412,21 @@ }, "farver": { "Package": "farver", - "Version": "2.1.1", + "Version": "2.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "8106d78941f34855c440ddb946b8f7a5" + "Hash": "680887028577f3fa2a81e410ed0d6e42" }, "fastmap": { "Package": "fastmap", - "Version": "1.1.1", + "Version": "1.2.0", "Source": "Repository", - "Repository": "RSPM", - "Hash": "f7736a18de97dea803bde0a2daaafb27" + "Repository": "CRAN", + "Hash": "aa5e1cd11c2d15497494c5292d7ffcc8" }, "flextable": { "Package": "flextable", - "Version": "0.9.5", + "Version": "0.9.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -483,7 +446,7 @@ "uuid", "xml2" ], - "Hash": "703b952d6be3f841274df7831ec95e5d" + "Hash": "b10ea358275721a0e90080d4a55a1a38" }, "fontBitstreamVera": { "Package": "fontBitstreamVera", @@ -509,7 +472,7 @@ "Package": "fontawesome", "Version": "0.5.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "htmltools", @@ -547,78 +510,60 @@ }, "fresh": { "Package": "fresh", - "Version": "0.2.0", + "Version": "0.2.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ + "bslib", "htmltools", "rstudioapi", "sass", "shiny" ], - "Hash": "fa54367040deb4537da49b7ac0ee5770" + "Hash": "7bdb5c90d4fe3cb14dcefbe837ce01da" }, "fs": { "Package": "fs", - "Version": "1.6.3", + "Version": "1.6.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "47b5f30c720c23999b913a1a635cf0bb" + "Hash": "15aeb8c27f5ea5161f9f6a641fafd93a" }, "gdtools": { "Package": "gdtools", - "Version": "0.3.7", + "Version": "0.4.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "Rcpp", - "curl", "fontquiver", - "gfonts", "htmltools", "systemfonts", "tools" ], - "Hash": "b53e23731a5946448ad888efca14d2df" + "Hash": "e8e09897fee8d96f6bb02bf841177d20" }, "generics": { "Package": "generics", "Version": "0.1.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "methods" ], "Hash": "15e9634c0fcd294799e9b2e929ed1b86" }, - "gfonts": { - "Package": "gfonts", - "Version": "0.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "crayon", - "crul", - "glue", - "htmltools", - "jsonlite", - "shiny", - "utils" - ], - "Hash": "a535d76cf92645364997a8751396d63b" - }, "ggplot2": { "Package": "ggplot2", "Version": "3.5.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "MASS", "R", @@ -641,18 +586,18 @@ }, "glue": { "Package": "glue", - "Version": "1.6.2", + "Version": "1.7.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e" + "Hash": "e0b3a53876554bd45879e596cdb10a52" }, "golem": { "Package": "golem", - "Version": "0.4.1", + "Version": "0.5.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -666,11 +611,11 @@ "utils", "yaml" ], - "Hash": "dc12172dc35c6c80e18b430dc546fc24" + "Hash": "11be24963e2f220c403eafd01e2259d5" }, "gtable": { "Package": "gtable", - "Version": "0.3.4", + "Version": "0.3.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -681,7 +626,7 @@ "lifecycle", "rlang" ], - "Hash": "b29cf3031f49b04ab9c852c912547eef" + "Hash": "e18861963cbc65a27736e02b3cd3c4a0" }, "here": { "Package": "here", @@ -695,14 +640,14 @@ }, "highr": { "Package": "highr", - "Version": "0.10", + "Version": "0.11", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "xfun" ], - "Hash": "06230136b2d2b9ba5805e1963fa6e890" + "Hash": "d65ba49117ca223614f71b60d85b8ab7" }, "hms": { "Package": "hms", @@ -722,7 +667,7 @@ "Package": "htmltools", "Version": "0.5.8.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "base64enc", @@ -749,16 +694,9 @@ ], "Hash": "04291cc45198225444a397606810ac37" }, - "httpcode": { - "Package": "httpcode", - "Version": "0.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "13641a1c6d2cc98801b76764078e17ea" - }, "httpuv": { "Package": "httpuv", - "Version": "1.6.13", + "Version": "1.6.15", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -769,7 +707,7 @@ "promises", "utils" ], - "Hash": "d23d2879001f3d82ee9dc38a9ef53c4c" + "Hash": "d55aa087c47a63ead0f6fc10f8fa1ee0" }, "isoband": { "Package": "isoband", @@ -786,7 +724,7 @@ "Package": "jquerylib", "Version": "0.1.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "htmltools" ], @@ -794,19 +732,19 @@ }, "jsonlite": { "Package": "jsonlite", - "Version": "1.8.8", + "Version": "1.8.9", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "methods" ], - "Hash": "e1b9c55281c5adc4dd113652d9e26768" + "Hash": "4e993b65c2c3ffbffce7bb3e2c6f832b" }, "knitr": { "Package": "knitr", - "Version": "1.46", + "Version": "1.48", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "evaluate", @@ -816,7 +754,7 @@ "xfun", "yaml" ], - "Hash": "6e008ab1d696a5283c79765fa7b56b47" + "Hash": "acf380f300c721da9fde7df115a5f86f" }, "labeling": { "Package": "labeling", @@ -842,7 +780,7 @@ }, "lattice": { "Package": "lattice", - "Version": "0.21-8", + "Version": "0.22-6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -853,7 +791,7 @@ "stats", "utils" ], - "Hash": "0b8a6d63c8770f02a8b5635f3c431e6b" + "Hash": "cc5ac1ba4c238c7ca9fa6a87ca11a7e2" }, "lifecycle": { "Package": "lifecycle", @@ -885,7 +823,7 @@ "Package": "magrittr", "Version": "2.0.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R" ], @@ -895,7 +833,7 @@ "Package": "memoise", "Version": "2.0.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "cachem", "rlang" @@ -904,7 +842,7 @@ }, "mgcv": { "Package": "mgcv", - "Version": "1.8-42", + "Version": "1.9-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -917,13 +855,13 @@ "stats", "utils" ], - "Hash": "3460beba7ccc8946249ba35327ba902a" + "Hash": "110ee9d83b496279960e162ac97764ce" }, "mime": { "Package": "mime", "Version": "0.12", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "tools" ], @@ -949,18 +887,18 @@ }, "munsell": { "Package": "munsell", - "Version": "0.5.0", + "Version": "0.5.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "colorspace", "methods" ], - "Hash": "6dfe8bf774944bd5595785e3229d8771" + "Hash": "4fd8900853b746af55b81fda99da7695" }, "nlme": { "Package": "nlme", - "Version": "3.1-162", + "Version": "3.1-166", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -970,11 +908,11 @@ "stats", "utils" ], - "Hash": "0984ce8da8da9ead8643c5cbbb60f83e" + "Hash": "ccbb8846be320b627e6aa2b4616a2ded" }, "officer": { "Package": "officer", - "Version": "0.6.5", + "Version": "0.6.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -989,25 +927,26 @@ "xml2", "zip" ], - "Hash": "3a71a529237487233ead151cba12be3f" + "Hash": "dc703d9a479e428a15dc6f82e268387e" }, "openssl": { "Package": "openssl", - "Version": "2.1.1", + "Version": "2.2.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "askpass" ], - "Hash": "2a0dc8c6adfb6f032e4d4af82d258ab5" + "Hash": "d413e0fef796c9401a4419485f709ca1" }, "patchwork": { "Package": "patchwork", - "Version": "1.2.0", + "Version": "1.3.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "cli", + "farver", "ggplot2", "grDevices", "graphics", @@ -1017,13 +956,13 @@ "stats", "utils" ], - "Hash": "9c8ab14c00ac07e9e04d1664c0b74486" + "Hash": "e23fb9ecb1258207bcb763d78d513439" }, "pillar": { "Package": "pillar", "Version": "1.9.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "cli", "fansi", @@ -1040,7 +979,7 @@ "Package": "pkgconfig", "Version": "2.0.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "utils" ], @@ -1066,9 +1005,9 @@ }, "promises": { "Package": "promises", - "Version": "1.2.1", + "Version": "1.3.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R6", "Rcpp", @@ -1078,13 +1017,13 @@ "rlang", "stats" ], - "Hash": "0d8a15c9d000970ada1ab21405387dee" + "Hash": "434cd5388a3979e74be5c219bcd6e77d" }, "purrr": { "Package": "purrr", "Version": "1.0.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", @@ -1097,20 +1036,20 @@ }, "ragg": { "Package": "ragg", - "Version": "1.2.7", + "Version": "1.3.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "systemfonts", "textshaping" ], - "Hash": "90a1b8b7e518d7f90480d56453b4d062" + "Hash": "0595fe5e47357111f29ad19101c7d271" }, "rappdirs": { "Package": "rappdirs", "Version": "0.3.3", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R" ], @@ -1118,13 +1057,13 @@ }, "reactR": { "Package": "reactR", - "Version": "0.5.0", + "Version": "0.6.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "htmltools" ], - "Hash": "c9014fd1a435b2d790dd506589cb24e5" + "Hash": "b8e3d93f508045812f47136c7c44c251" }, "reactable": { "Package": "reactable", @@ -1143,28 +1082,28 @@ }, "renv": { "Package": "renv", - "Version": "1.0.3", + "Version": "1.0.8", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "utils" ], - "Hash": "41b847654f567341725473431dd0d5ab" + "Hash": "e082251834fa427514e68bec8afc8fda" }, "rlang": { "Package": "rlang", - "Version": "1.1.3", + "Version": "1.1.4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "42548638fae05fd9a9b5f3f437fbbbe2" + "Hash": "3eec01f8b1dee337674b2e34ab1f9bc1" }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.26", + "Version": "2.28", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1183,7 +1122,7 @@ "xfun", "yaml" ], - "Hash": "9b148e7f95d33aac01f31282d49e4f44" + "Hash": "062470668513dcda416927085ee9bdc7" }, "rprojroot": { "Package": "rprojroot", @@ -1197,14 +1136,14 @@ }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.15.0", + "Version": "0.16.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "5564500e25cffad9e22244ced1379887" + "Hash": "96710351d642b70e8f02ddeb237c46a7" }, "sass": { "Package": "sass", - "Version": "0.4.8", + "Version": "0.4.9", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1214,7 +1153,7 @@ "rappdirs", "rlang" ], - "Hash": "168f9353c76d4c4b0a0bbf72e2c2d035" + "Hash": "d53dbfddf695303ea4ad66f86e99b95d" }, "scales": { "Package": "scales", @@ -1238,9 +1177,9 @@ }, "shiny": { "Package": "shiny", - "Version": "1.8.1.1", + "Version": "1.9.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", @@ -1267,7 +1206,7 @@ "withr", "xtable" ], - "Hash": "54b26646816af9960a4c64d8ceec75d6" + "Hash": "6a293995a66e12c48d13aa1f957d09c7" }, "shinyFeedback": { "Package": "shinyFeedback", @@ -1285,7 +1224,7 @@ }, "shinycssloaders": { "Package": "shinycssloaders", - "Version": "1.0.0", + "Version": "1.1.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1293,9 +1232,10 @@ "digest", "glue", "grDevices", + "htmltools", "shiny" ], - "Hash": "f39bb3c44a9b496723ec7e86f9a771d8" + "Hash": "2b45a467a30d6a88a1892a738c0900cf" }, "shinydashboard": { "Package": "shinydashboard", @@ -1313,7 +1253,7 @@ }, "shinydashboardPlus": { "Package": "shinydashboardPlus", - "Version": "2.0.4", + "Version": "2.0.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1324,7 +1264,7 @@ "shinydashboard", "waiter" ], - "Hash": "a0542621306173a03076b28cf0a65c4d" + "Hash": "ff1710014dcc05d070b67a2689020a36" }, "shinyjs": { "Package": "shinyjs", @@ -1343,7 +1283,7 @@ "Package": "sourcetools", "Version": "0.1.7-1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R" ], @@ -1351,7 +1291,7 @@ }, "stringi": { "Package": "stringi", - "Version": "1.8.3", + "Version": "1.8.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1360,7 +1300,7 @@ "tools", "utils" ], - "Hash": "058aebddea264f4c99401515182e656a" + "Hash": "39e1144fd75428983dc3f63aa53dfa91" }, "stringr": { "Package": "stringr", @@ -1383,37 +1323,39 @@ "Package": "sys", "Version": "3.4.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Hash": "3a1be13d68d47a8cd0bfd74739ca1555" }, "systemfonts": { "Package": "systemfonts", - "Version": "1.0.5", + "Version": "1.1.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", - "cpp11" + "cpp11", + "lifecycle" ], - "Hash": "15b594369e70b975ba9f064295983499" + "Hash": "213b6b8ed5afbf934843e6c3b090d418" }, "textshaping": { "Package": "textshaping", - "Version": "0.3.7", + "Version": "0.4.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "cpp11", + "lifecycle", "systemfonts" ], - "Hash": "997aac9ad649e0ef3b97f96cddd5622b" + "Hash": "5142f8bc78ed3d819d26461b641627ce" }, "tibble": { "Package": "tibble", "Version": "3.2.1", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "fansi", @@ -1469,47 +1411,24 @@ }, "timechange": { "Package": "timechange", - "Version": "0.2.0", + "Version": "0.3.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "cpp11" ], - "Hash": "8548b44f79a35ba1791308b61e6012d7" + "Hash": "c5f3c201b931cd6474d17d8700ccb1c8" }, "tinytex": { "Package": "tinytex", - "Version": "0.50", + "Version": "0.53", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "xfun" ], - "Hash": "be7a76845222ad20adb761f462eed3ea" - }, - "triebeard": { - "Package": "triebeard", - "Version": "0.4.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Rcpp" - ], - "Hash": "642507a148b0dd9b5620177e0a044413" - }, - "urltools": { - "Package": "urltools", - "Version": "1.7.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "Rcpp", - "methods", - "triebeard" - ], - "Hash": "e86a704261a105f4703f653e05defa3e" + "Hash": "9db859e8aabbb474293dde3097839420" }, "utf8": { "Package": "utf8", @@ -1523,13 +1442,13 @@ }, "uuid": { "Package": "uuid", - "Version": "1.1-1", + "Version": "1.2-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "3d78edfb977a69fc7a0341bee25e163f" + "Hash": "34e965e62a41fcafb1ca60e9b142085b" }, "vctrs": { "Package": "vctrs", @@ -1569,28 +1488,28 @@ }, "withr": { "Package": "withr", - "Version": "2.5.2", + "Version": "3.0.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "grDevices", - "graphics", - "stats" + "graphics" ], - "Hash": "4b25e70111b7d644322e9513f403a272" + "Hash": "07909200e8bbe90426fbfeb73e1e27aa" }, "xfun": { "Package": "xfun", - "Version": "0.43", + "Version": "0.47", "Source": "Repository", "Repository": "CRAN", "Requirements": [ + "R", "grDevices", "stats", "tools" ], - "Hash": "ab6371d8653ce5f2f9290f4ec7b42a8e" + "Hash": "36ab21660e2d095fef0d83f689e0477c" }, "xml2": { "Package": "xml2", @@ -1609,7 +1528,7 @@ "Package": "xtable", "Version": "1.8-4", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "stats", @@ -1619,17 +1538,17 @@ }, "yaml": { "Package": "yaml", - "Version": "2.3.8", + "Version": "2.3.10", "Source": "Repository", "Repository": "CRAN", - "Hash": "29240487a071f535f5e5d5a323b7afbd" + "Hash": "51dab85c6c98e50a18d7551e9d49f76c" }, "zip": { "Package": "zip", - "Version": "2.3.0", + "Version": "2.3.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "d98c94dacb7e0efcf83b0a133a705504" + "Hash": "fcc4bd8e6da2d2011eb64a5e5cc685ab" }, "zoo": { "Package": "zoo", diff --git a/renv/activate.R b/renv/activate.R index cb5401f9..2ebe4034 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,11 +2,13 @@ local({ # the requested version of renv - version <- "1.0.3" + version <- "1.0.8" attr(version, "sha") <- NULL # the project directory - project <- getwd() + project <- Sys.getenv("RENV_PROJECT") + if (!nzchar(project)) + project <- getwd() # use start-up diagnostics if enabled diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE") @@ -31,6 +33,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( @@ -50,9 +60,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") @@ -75,6 +98,66 @@ local({ unloadNamespace("renv") # load bootstrap tools + ansify <- function(text) { + if (renv_ansify_enabled()) + renv_ansify_enhanced(text) + else + renv_ansify_default(text) + } + + renv_ansify_enabled <- function() { + + override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA) + if (!is.na(override)) + return(as.logical(override)) + + pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA) + if (identical(pane, "build")) + return(FALSE) + + testthat <- Sys.getenv("TESTTHAT", unset = "false") + if (tolower(testthat) %in% "true") + return(FALSE) + + iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false") + if (tolower(iderun) %in% "false") + return(FALSE) + + TRUE + + } + + renv_ansify_default <- function(text) { + text + } + + renv_ansify_enhanced <- function(text) { + + # R help links + pattern <- "`\\?(renv::(?:[^`])+)`" + replacement <- "`\033]8;;ide:help:\\1\a?\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # runnable code + pattern <- "`(renv::(?:[^`])+)`" + replacement <- "`\033]8;;ide:run:\\1\a\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # return ansified text + text + + } + + renv_ansify_init <- function() { + + envir <- renv_envir_self() + if (renv_ansify_enabled()) + assign("ansify", renv_ansify_enhanced, envir = envir) + else + assign("ansify", renv_ansify_default, envir = envir) + + } + `%||%` <- function(x, y) { if (is.null(x)) y else x } @@ -108,6 +191,24 @@ local({ } + heredoc <- function(text, leave = 0) { + + # remove leading, trailing whitespace + trimmed <- gsub("^\\s*\\n|\\n\\s*$", "", text) + + # split into lines + lines <- strsplit(trimmed, "\n", fixed = TRUE)[[1L]] + + # compute common indent + indent <- regexpr("[^[:space:]]", lines) + common <- min(setdiff(indent, -1L)) - leave + text <- paste(substring(lines, common), collapse = "\n") + + # substitute in ANSI links for executable renv code + ansify(text) + + } + startswith <- function(string, prefix) { substring(string, 1, nchar(prefix)) == prefix } @@ -268,7 +369,11 @@ local({ ) if ("headers" %in% names(formals(utils::download.file))) - args$headers <- renv_bootstrap_download_custom_headers(url) + { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } do.call(utils::download.file, args) @@ -347,10 +452,22 @@ local({ for (type in types) { for (repos in renv_bootstrap_repos()) { + # build arguments for utils::available.packages() call + args <- list(type = type, repos = repos) + + # add custom headers if available -- note that + # utils::available.packages() will pass this to download.file() + if ("headers" %in% names(formals(utils::download.file))) + { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } + # retrieve package database db <- tryCatch( as.data.frame( - utils::available.packages(type = type, repos = repos), + do.call(utils::available.packages, args), stringsAsFactors = FALSE ), error = identity @@ -432,6 +549,14 @@ local({ } + renv_bootstrap_github_token <- function() { + for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(envval) + } + } + renv_bootstrap_download_github <- function(version) { enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") @@ -439,16 +564,16 @@ local({ return(FALSE) # prepare download options - pat <- Sys.getenv("GITHUB_PAT") - if (nzchar(Sys.which("curl")) && nzchar(pat)) { + token <- renv_bootstrap_github_token() + if (nzchar(Sys.which("curl")) && nzchar(token)) { fmt <- "--location --fail --header \"Authorization: token %s\"" - extra <- sprintf(fmt, pat) + extra <- sprintf(fmt, token) saved <- options("download.file.method", "download.file.extra") options(download.file.method = "curl", download.file.extra = extra) on.exit(do.call(base::options, saved), add = TRUE) - } else if (nzchar(Sys.which("wget")) && nzchar(pat)) { + } else if (nzchar(Sys.which("wget")) && nzchar(token)) { fmt <- "--header=\"Authorization: token %s\"" - extra <- sprintf(fmt, pat) + extra <- sprintf(fmt, token) saved <- options("download.file.method", "download.file.extra") options(download.file.method = "wget", download.file.extra = extra) on.exit(do.call(base::options, saved), add = TRUE) @@ -610,6 +735,9 @@ local({ # if the user has requested an automatic prefix, generate it auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA) + if (is.na(auto) && getRversion() >= "4.4.0") + auto <- "TRUE" + if (auto %in% c("TRUE", "True", "true", "1")) return(renv_bootstrap_platform_prefix_auto()) @@ -801,24 +929,23 @@ local({ # 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"]])) { + dev <- identical(description[["RemoteType"]], "github") + remote <- if (dev) paste("rstudio/renv", description[["RemoteSha"]], sep = "@") - } else { + else paste("renv", description[["Version"]], sep = "@") - } # display both loaded version + sha if available friendly <- renv_bootstrap_version_friendly( version = description[["Version"]], - sha = description[["RemoteSha"]] + sha = if (dev) 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.", - sep = "\n" - ) + fmt <- heredoc(" + 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. + ") catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote) FALSE @@ -1041,7 +1168,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) @@ -1050,7 +1177,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) @@ -1063,14 +1190,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]] @@ -1118,14 +1245,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))) { @@ -1152,7 +1279,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)) } }