### Install tidyr Package Source: https://github.com/tidyverse/tidyr/blob/main/README.md Install the tidyr package. The easiest way is to install the whole tidyverse. Alternatively, install just tidyr or the development version from GitHub. ```r install.packages("tidyverse") ``` ```r install.packages("tidyr") ``` ```r # install.packages("pak") pak::pak("tidyverse/tidyr") ``` -------------------------------- ### Package Installation Failure Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md Indicates a general installation failure for a package. Check the specified output file for detailed error messages. ```text Installation failed. See ‘/tmp/workdir/INSPECTumours/new/INSPECTumours.Rcheck/00install.out’ for details. ``` -------------------------------- ### Example Execution Error in ggpubr Source: https://github.com/tidyverse/tidyr/blob/main/revdep/problems.md This error occurred during the checking of examples for the 'ggpubr' package. The execution halted with a complex call stack involving 'tidyselect' and 'rlang', indicating an issue with argument evaluation or selection within the examples. ```R Running examples in ‘ggpubr-Ex.R’ failed The error most likely occurred in: > ### Name: ggsummarytable > ### Title: GGPLOT with Summary Stats Table Under the Plot > ### Aliases: ggsummarytable ggsummarystats print.ggsummarystats > ### print.ggsummarystats_list > > ### ** Examples > ... 6. └─tidyselect::eval_select(expr(c(...)), data, allow_rename = FALSE) 7. └─tidyselect:::eval_select_impl(...) 8. ├─tidyselect:::with_subscript_errors(...) 9. │ └─rlang::try_fetch(...) 10. │ └─base::withCallingHandlers(...) 11. └─tidyselect:::vars_select_eval(...) 12. └─tidyselect:::ensure_named(...) 13. └─cli::cli_abort(...) 14. └─rlang::abort(...) Execution halted ``` -------------------------------- ### R Package Installation Check Failure Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output indicates a general installation failure for an R package, where the installation process itself failed. The specific details of the failure would be found in the '/tmp/workdir/PACKAGE_NAME/new/PACKAGE_NAME.Rcheck/00install.out' file. ```r Installation failed. See ‘/tmp/workdir/ESTER/new/ESTER.Rcheck/00install.out’ for details. ``` ```r Installation failed. See ‘/tmp/workdir/FAMetA/new/FAMetA.Rcheck/00install.out’ for details. ``` -------------------------------- ### R Package Installation Failure (bayesnec) Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output shows an installation failure for the 'bayesnec' package, with details to be found in the '00install.out' file. It also notes that the 'rstan' package is suggested but not available for checking. ```R * checking whether package ‘bayesnec’ can be installed ... ERROR ``` Installation failed. See ‘/tmp/workdir/bayesnec/new/bayesnec.Rcheck/00install.out’ for details. ``` * checking package dependencies ... NOTE ``` Package suggested but not available for checking: ‘rstan’ ``` ## Installation ``` -------------------------------- ### ordbetareg Installation Failure Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output indicates that the 'ordbetareg' package failed to install. The error message points to the installation log file for details. ```text * checking whether package ‘ordbetareg’ can be installed ... ERROR Installation failed. See ‘/tmp/workdir/ordbetareg/new/ordbetareg.Rcheck/00install.out’ for details. ``` -------------------------------- ### ordbetareg Devel Installation Error Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This log details the installation process for the 'ordbetareg' package during development. It highlights warnings about missing namespaces ('rstan', 'ordbetareg') and a critical error during byte-compilation due to the absence of the 'brms' package, which itself depends on 'rstan'. ```text * installing *source* package ‘ordbetareg’ ... ** package ‘ordbetareg’ successfully unpacked and MD5 sums checked ** using staged installation ** R ** data *** moving datasets to lazyload DB Warning: namespace ‘rstan’ is not available and has been replaced by .GlobalEnv when processing object ‘ord_fit_mean’ Warning: namespace ‘ordbetareg’ is not available and has been replaced by .GlobalEnv when processing object ‘ord_fit_mean’ ... by .GlobalEnv when processing object ‘ord_fit_phi’ Warning: namespace ‘rstan’ is not available and has been replaced by .GlobalEnv when processing object ‘ord_fit_phi’ ** inst ** byte-compile and prepare package for lazy loading Error: package or namespace load failed for ‘brms’ in loadNamespace(j <- imp[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘rstan’ Execution halted ERROR: lazy loading failed for package ‘ordbetareg’ * removing ‘/tmp/workdir/ordbetareg/new/ordbetareg.Rcheck/ordbetareg’ ``` -------------------------------- ### R Package Installation Failure: Missing 'rstan' Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output shows an installation failure for the 'ESTER' R package, specifically an error during lazy loading because the 'rstan' package is not found. This indicates a missing dependency required for the package's functionality. ```r * installing *source* package ‘ESTER’ ... ** package ‘ESTER’ successfully unpacked and MD5 sums checked ** using staged installation ** R ** inst ** byte-compile and prepare package for lazy loading Error in loadNamespace(j <- imp[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘rstan’ Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart Execution halted ERROR: lazy loading failed for package ‘ESTER’ * removing ‘/tmp/workdir/ESTER/new/ESTER.Rcheck/ESTER’ ``` ```r * installing *source* package ‘ESTER’ ... ** package ‘ESTER’ successfully unpacked and MD5 sums checked ** using staged installation ** R ** inst ** byte-compile and prepare package for lazy loading Error in loadNamespace(j <- imp[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘rstan’ Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart Execution halted ERROR: lazy loading failed for package ‘ESTER’ * removing ‘/tmp/workdir/ESTER/old/ESTER.Rcheck/ESTER’ ``` -------------------------------- ### Installed Package Size Note Source: https://github.com/tidyverse/tidyr/blob/main/revdep/problems.md This note indicates that the installed size of the 'gprofiler2' package is 5.5MB, with the 'doc' sub-directory consuming 5.3MB. This is a common check to identify packages with unusually large documentation. ```R installed size is 5.5Mb sub-directories of 1Mb or more: doc 5.3Mb ``` -------------------------------- ### ordbetareg CRAN Installation Error Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This log shows the installation process for 'ordbetareg' on CRAN. It mirrors the devel installation error, indicating that the package fails to install because 'brms' cannot be loaded due to the missing 'rstan' package. ```text * installing *source* package ‘ordbetareg’ ... ** package ‘ordbetareg’ successfully unpacked and MD5 sums checked ** using staged installation ** R ** data *** moving datasets to lazyload DB Warning: namespace ‘rstan’ is not available and has been replaced by .GlobalEnv when processing object ‘ord_fit_mean’ Warning: namespace ‘ordbetareg’ is not available and has been replaced by .GlobalEnv when processing object ‘ord_fit_mean’ ... by .GlobalEnv when processing object ‘ord_fit_phi’ Warning: namespace ‘rstan’ is not available and has been replaced by .GlobalEnv when processing object ‘ord_fit_phi’ ** inst ** byte-compile and prepare package for lazy loading Error: package or namespace load failed for ‘brms’ in loadNamespace(j <- imp[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘rstan’ Execution halted ERROR: lazy loading failed for package ‘ordbetareg’ * removing ‘/tmp/workdir/ordbetareg/old/ordbetareg.Rcheck/ordbetareg’ ``` -------------------------------- ### R Package Installation Failure: Missing 'readMzXmlData' Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output details an installation failure for the 'FAMetA' R package. The error occurs during byte-compilation and lazy loading, stating that the 'LipidMS' package could not be loaded because the 'readMzXmlData' package is missing. This highlights a dependency issue within 'LipidMS'. ```r * installing *source* package ‘FAMetA’ ... ** package ‘FAMetA’ successfully unpacked and MD5 sums checked ** using staged installation ** R ** data *** moving datasets to lazyload DB ** inst ** byte-compile and prepare package for lazy loading Error: package or namespace load failed for ‘LipidMS’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘readMzXmlData’ Execution halted ERROR: lazy loading failed for package ‘FAMetA’ * removing ‘/tmp/workdir/FAMetA/new/FAMetA.Rcheck/FAMetA’ ``` -------------------------------- ### Load tidyr Library Source: https://github.com/tidyverse/tidyr/blob/main/README.md Load the tidyr library into your R session to start using its functions. ```r library(tidyr) ``` -------------------------------- ### Multiple Names Require names_sep or names_pattern Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-long.md When `names_to` specifies multiple names, you must also provide either `names_sep` or `names_pattern` to guide how the names are split. ```R build_longer_spec(df, x_y, names_to = c("a", "b")) ``` ```R build_longer_spec(df, x_y, names_to = c("a", "b"), names_sep = "x", names_pattern = "x") ``` -------------------------------- ### R Package Lazy Loading Error Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md Occurs during package installation when a required dependency ('rstan' in this case) is not found, preventing lazy loading. ```text * installing *source* package ‘INSPECTumours’ ... ** package ‘INSPECTumours’ successfully unpacked and MD5 sums checked ** using staged installation ** R ** data *** moving datasets to lazyload DB ** inst ** byte-compile and prepare package for lazy loading Error in loadNamespace(j <- imp[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘rstan’ Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart Execution halted ERROR: lazy loading failed for package ‘INSPECTumours’ * removing ‘/tmp/workdir/INSPECTumours/new/INSPECTumours.Rcheck/INSPECTumours’ ``` -------------------------------- ### Workpatterns classify example error Source: https://github.com/tidyverse/tidyr/blob/main/revdep/problems.md An error encountered when running examples for the `workpatterns_classify` function, indicating an issue with data.table assignment within the function's internal operations. ```R # Returns a plot by default em_data %>% workpatterns_classify(method = "bw") ``` -------------------------------- ### ggstatsplot Package Check Results (CRAN) Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output shows the CRAN package check results for ggstatsplot. It reports a NOTE, indicating potential issues that do not prevent package installation but may warrant attention. ```text * using log directory ‘/tmp/workdir/ggstatsplot/old/ggstatsplot.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘ggstatsplot/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘ggstatsplot’ version ‘0.10.0’ * package encoding: UTF-8 * checking package namespace information ... OK ... Running ‘spelling.R’ Running ‘testthat.R’ * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking running R code from vignettes ... NONE ‘additional.Rmd’ using ‘UTF-8’... OK ‘ggstatsplot.Rmd’ using ‘UTF-8’... OK * checking re-building of vignette outputs ... OK * DONE Status: 1 NOTE ``` -------------------------------- ### Build and apply manual pivot specifications Source: https://context7.com/tidyverse/tidyr/llms.txt Use `build_longer_spec()` and `build_wider_spec()` to create specification data frames for complex pivoting. `pivot_longer_spec()` and `pivot_wider_spec()` then apply these specs. ```R # Build and inspect a spec before pivoting spec <- relig_income | build_longer_spec( cols = !religion, names_to = "income", values_to = "count" ) spec ``` ```R pivot_longer_spec(relig_income, spec) ``` ```R # Customize the output column names by mutating the spec spec1 <- us_rent_income | build_wider_spec( names_from = variable, values_from = c(estimate, moe) ) spec2 <- spec1 | dplyr::mutate( .name = paste0(variable, ifelse(.value == "moe", "_moe", "")) ) us_rent_income |> pivot_wider_spec(spec2) ``` ```R # Hand-craft a spec for government tables where column names encode # two independent variables (units AND region) spec <- tibble::tribble( ~.name, ~.value, ~units, ~region, "1 unit", "n", "1", NA, "2 to 4 units", "n", "2-4", NA, "5 units or more", "n", "5+", NA, "Northeast", "n", NA, "Northeast", "Midwest", "n", NA, "Midwest", ) construction |> pivot_longer_spec(spec) ``` -------------------------------- ### Using tidyselect backend for variable selection in drop_na() Source: https://github.com/tidyverse/tidyr/blob/main/NEWS.md Demonstrates how to use the tidyselect backend for selecting variables in `drop_na()`. It shows explicit unquoting with `!!` to refer to variables from the environment and how select helpers like `starts_with()` are treated as context expressions. ```R x <- 2 drop_na(df, 2) # Works fine drop_na(df, x) # Object 'x' not found drop_na(df, !! x) # Works as if you had supplied 2 ``` ```R x <- "d" drop_na(df, starts_with(x)) ``` -------------------------------- ### Warn when .key and ... are supplied together Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/nest.md nest_info() and nest() will issue a warning if both .key and ... are supplied, as .key will be ignored in favor of .... ```R out <- nest_info(df, data = 2, .key = "foo") ``` ```R out <- nest(df, data = 2, .key = "foo") ``` -------------------------------- ### Package Build Log - Devel Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This log shows the output of a package build process during development. It includes checks for package description, namespace information, dependencies, and vignette compilation. The log indicates a '1 NOTE' status. ```text * using log directory ‘/tmp/workdir/OlinkAnalyze/new/OlinkAnalyze.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘OlinkAnalyze/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘OlinkAnalyze’ version ‘3.2.2’ * package encoding: UTF-8 * checking package namespace information ... OK ... * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... OK Running ‘testthat.R’ * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking running R code from vignettes ... NONE ‘Vignett.Rmd’ using ‘UTF-8’... OK * checking re-building of vignette outputs ... OK * DONE Status: 1 NOTE ``` -------------------------------- ### Analyze Package Downloads for Revdep Problems Source: https://github.com/tidyverse/tidyr/blob/main/revdep/revdep-downloads.md This script retrieves package names from a problems file, fetches their download counts for the last month using cranlogs, and calculates proportions and cumulative proportions of downloads. It's useful for prioritizing investigations based on download volume. ```r library(tidyverse) new_problems_path <- here::here("revdep/problems.md") md <- readLines(new_problems_path) pkg <- md %>% str_subset("^#[^#]") %>% str_extract("[[:alnum:]]+") dl <- cranlogs::cran_downloads(when = "last-month", packages = pkg) dl_count <- dl %>% count(package, wt = count) %>% mutate(package = fct_reorder(package, n)) %>% arrange(desc(package)) dl_count %>% mutate( prop = n / sum(n), cum_prop = cumsum(prop) ) %>% print(n = 20) ``` -------------------------------- ### names_sep Fails with Single Name Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-long.md The `names_sep` argument cannot be used when `names_to` is a single name. ```R build_longer_spec(df, x_y, names_to = "x", names_sep = "_") ``` -------------------------------- ### pivot_longer_spec requires empty dots Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-long.md pivot_longer_spec() requires that the dots (`...`) be empty. This example shows an error when an unused numeric argument is passed. ```R pivot_longer_spec(df, spec, 1) ``` -------------------------------- ### Package Build Log - CRAN Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This log details the output from a CRAN package build process. Similar to the devel log, it covers standard package checks, dependency verification, and vignette processing, concluding with a '1 NOTE' status. ```text * using log directory ‘/tmp/workdir/OlinkAnalyze/old/OlinkAnalyze.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘OlinkAnalyze/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘OlinkAnalyze’ version ‘3.2.2’ * package encoding: UTF-8 * checking package namespace information ... OK ... * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... OK Running ‘testthat.R’ * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking running R code from vignettes ... NONE ‘Vignett.Rmd’ using ‘UTF-8’... OK * checking re-building of vignette outputs ... OK * DONE Status: 1 NOTE ``` -------------------------------- ### build_longer_spec requires empty dots Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-long.md build_longer_spec() requires that the dots (`...`) be empty. This example shows an error when an unused numeric argument is passed. ```R build_longer_spec(df, c(x, y), 1) ``` -------------------------------- ### pivot_longer unused dots Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-long.md pivot_longer() requires all arguments passed through the dots to be used. This example shows an error when an unused numeric argument is provided. ```R pivot_longer(df, c(x, y), 1) ``` -------------------------------- ### Warn about .key with new interface Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/nest.md When using the new interface of nest() with named arguments in ..., supplying .key will result in a warning, as .key will be ignored. ```R out <- nest(df, y = y, .key = "foo") ``` -------------------------------- ### pivot_longer_spec unused named dots Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-long.md pivot_longer_spec() errors if any arguments are passed through the dots, including named arguments. This example shows an error with an unused named argument `col_vary`. ```R pivot_longer_spec(df, spec, col_vary = "slowest") ``` -------------------------------- ### Visualize Top Package Downloads Source: https://github.com/tidyverse/tidyr/blob/main/revdep/revdep-downloads.md Generates a bar chart of the top 20 packages by download count, with coordinates flipped for better readability of package names. This visualization helps in quickly identifying the most downloaded packages among those with revdep issues. ```r ggplot(head(dl_count, 20), aes(package, n)) + geom_col() + coord_flip() ``` -------------------------------- ### build_longer_spec unused named dots Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-long.md build_longer_spec() errors if any arguments are passed through the dots, including named arguments. This example shows an error with an unused named argument `name_to`. ```R build_longer_spec(df, c(x, y), name_to = "name") ``` -------------------------------- ### R Package Build Output (afex) Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output shows the results of a package build process, indicating a '1 NOTE' status. It details the R version, platform, and checks performed on package files and vignettes. ```R * using log directory ‘/tmp/workdir/afex/new/afex.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘afex/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘afex’ version ‘1.2-1’ * package encoding: UTF-8 * checking package namespace information ... OK ... ‘afex_analysing_accuracy_data.Rmd’ using ‘UTF-8’... OK ‘afex_anova_example.Rmd’ using ‘UTF-8’... OK ‘afex_mixed_example.Rmd’ using ‘UTF-8’... OK ‘afex_plot_introduction.Rmd’ using ‘UTF-8’... OK ‘afex_plot_supported_models.Rmd’ using ‘UTF-8’... OK ‘assumptions_of_ANOVAs.Rmd’ using ‘UTF-8’... OK ‘introduction-mixed-models.pdf.asis’ using ‘UTF-8’... OK * checking re-building of vignette outputs ... OK * DONE Status: 1 NOTE ``` ```R * using log directory ‘/tmp/workdir/afex/old/afex.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘afex/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘afex’ version ‘1.2-1’ * package encoding: UTF-8 * checking package namespace information ... OK ... ‘afex_analysing_accuracy_data.Rmd’ using ‘UTF-8’... OK ‘afex_anova_example.Rmd’ using ‘UTF-8’... OK ‘afex_mixed_example.Rmd’ using ‘UTF-8’... OK ‘afex_plot_introduction.Rmd’ using ‘UTF-8’... OK ‘afex_plot_supported_models.Rmd’ using ‘UTF-8’... OK ‘assumptions_of_ANOVAs.Rmd’ using ‘UTF-8’... OK ‘introduction-mixed-models.pdf.asis’ using ‘UTF-8’... OK * checking re-building of vignette outputs ... OK * DONE Status: 1 NOTE ``` -------------------------------- ### pivot_longer unused named dots Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-long.md pivot_longer() also errors if a named argument is passed through the dots and not used. This example demonstrates an error with an unused named argument `col_vary`. ```R pivot_longer(df, c(x, y), col_vary = "slowest") ``` -------------------------------- ### Complete data frame and fill new NAs with defaults Source: https://context7.com/tidyverse/tidyr/llms.txt Use `complete` with the `fill` argument to replace newly created `NA` values (from completing combinations) with specified defaults. Set `explicit = FALSE` to only fill newly created NAs, not pre-existing ones. ```r df <- tibble( group = c(1:2, 1, 2), item_id = c(1:2, 2, 3), item_name = c("a", "a", "b", "b"), value1 = c(1, NA, 3, 4), value2 = 4:7 ) # Fill newly-created NAs with defaults df | complete( group, nesting(item_id, item_name), fill = list(value1 = 0, value2 = 99), explicit = FALSE # only fill new rows, not pre-existing NAs ) ``` -------------------------------- ### Error: Names must be unique Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/unnest-wider.md This error indicates duplicate names within the elements being unnested. Use the `names_repair` argument to specify how to handle these duplicate names, for example, by making them unique. ```R unnest_wider(df, col) ``` -------------------------------- ### Use legacy nest/unnest functions Source: https://github.com/tidyverse/tidyr/blob/main/NEWS.md If automatic translation of nest() and unnest() to the new syntax fails, use these legacy functions as a temporary workaround until your code can be updated. ```r library(tidyr) nest <- nest_legacy unnest <- unnest_legacy ``` -------------------------------- ### tidyposterior Devel Check Output Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output details the development check for the tidyposterior package, specifically highlighting a critical error due to a missing dependency. ```text * using log directory ‘/tmp/workdir/tidyposterior/new/tidyposterior.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘tidyposterior/DESCRIPTION’ ... OK * this is package ‘tidyposterior’ version ‘1.0.0’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... ERROR Package required but not available: ‘rstanarm’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. * DONE Status: 1 ERROR ``` -------------------------------- ### Error: `names_sep` must be a single string or `NULL` Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/unnest-wider.md The `names_sep` argument must be a single string or `NULL`. Providing a number or other data type will result in an error. ```R unnest_wider(df, x, names_sep = 1) ``` -------------------------------- ### Generate all combinations of vectors with expand_grid Source: https://context7.com/tidyverse/tidyr/llms.txt Use `expand_grid` to create a tibble containing all possible combinations of elements from the provided vectors. By default, the first vector varies slowest. ```r # expand_grid: all combinations of two vectors expand_grid(x = 1:3, y = 1:2) ``` -------------------------------- ### Handle variable-length strings with splitting policies Source: https://context7.com/tidyverse/tidyr/llms.txt When splitting strings with `separate_wider_delim`, use `too_few` and `too_many` arguments to control how variable-length strings are handled. `too_few = "align_start"` pads short matches with NA on the right, and `too_many = "merge"` merges excess pieces into the last column. ```r df2 <- tibble(id = 1:4, x = c("x", "x y", "x y z", NA)) df2 | separate_wider_delim( x, delim = " ", names = c("a", "b"), too_few = "align_start", # pad short matches with NA on right too_many = "merge" # merge excess pieces into last column ) ``` -------------------------------- ### tidybayes Devel Check Output Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output summarizes the development check for the tidybayes package, noting dependency issues and vignette processing. ```text * using log directory ‘/tmp/workdir/tidybayes/new/tidybayes.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘tidybayes/DESCRIPTION’ ... OK * this is package ‘tidybayes’ version ‘3.0.2’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... NOTE ... * checking package vignettes in ‘inst/doc’ ... OK * checking running R code from vignettes ... NONE ‘tidy-brms.Rmd’ using ‘UTF-8’... OK ‘tidy-posterior.Rmd’ using ‘UTF-8’... OK ‘tidy-rstanarm.Rmd’ using ‘UTF-8’... OK ‘tidybayes-residuals.Rmd’ using ‘UTF-8’... OK ‘tidybayes.Rmd’ using ‘UTF-8’... OK * checking re-building of vignette outputs ... OK * DONE Status: 2 NOTEs ``` -------------------------------- ### Expand with continuous sequences using full_seq() Source: https://context7.com/tidyverse/tidyr/llms.txt Combine `expand()` with `full_seq()` to fill continuous gaps in a sequence, useful for time-series data. ```R fruits |> expand(type, full_seq(year, 1)) ``` -------------------------------- ### Handling Variable Context Not Set Warnings Source: https://github.com/tidyverse/tidyr/blob/main/NEWS.md To resolve warnings about 'variable context not set' when using helpers like everything() with underscored tidyr verbs, quote the helper with a formula. ```R drop_na(df, ~everything()) ``` -------------------------------- ### Expand() respects .name_repair Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/expand.md Shows how `expand()` handles duplicate column names using the `.name_repair` argument, renaming them uniquely. ```R out <- expand(df, x = x, x = x, .name_repair = "unique") ``` -------------------------------- ### ggPMX Package Check Failures (CRAN) Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output details the package check results for ggPMX on CRAN. It highlights a test failure and execution halt, similar to the development check. ```text * using log directory ‘/tmp/workdir/ggPMX/old/ggPMX.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘ggPMX/DESCRIPTION’ ... OK * this is package ‘ggPMX’ version ‘1.2.8’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... NOTE ... [ FAIL 1 | WARN 14 | SKIP 8 | PASS 327 ] Error: Test failures Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking running R code from vignettes ... NONE ‘ggPMX-guide.Rmd’ using ‘UTF-8’... OK * checking re-building of vignette outputs ... OK * DONE Status: 1 ERROR, 2 NOTEs ``` -------------------------------- ### nesting() respects .name_repair Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/expand.md Demonstrates how `nesting()` manages duplicate column names using the `.name_repair` argument. ```R out <- nesting(x = x, x = x, .name_repair = "unique") ``` -------------------------------- ### Warn about old interface with .by Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/nest.md When using the old interface of nest() with .by, a warning is issued, and it suggests explicit naming for the data selection. ```R out <- nest(df, y, .by = x) ``` ```R out <- nest(df, y, .by = x, .key = "foo") ``` -------------------------------- ### ggPMX Package Check Failures (Devel) Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output shows the results of a package check for ggPMX in development mode. It indicates a test failure and execution halt. ```text * using log directory ‘/tmp/workdir/ggPMX/new/ggPMX.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘ggPMX/DESCRIPTION’ ... OK * this is package ‘ggPMX’ version ‘1.2.8’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... NOTE ... [ FAIL 1 | WARN 14 | SKIP 8 | PASS 327 ] Error: Test failures Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking running R code from vignettes ... NONE ‘ggPMX-guide.Rmd’ using ‘UTF-8’... OK * checking re-building of vignette outputs ... OK * DONE Status: 1 ERROR, 2 NOTEs ``` -------------------------------- ### Warning: unnest() new interface with multiple columns Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/unnest.md This warning indicates that `unnest()` has a new interface. It suggests using `unnest(c(x, y))` with `mutate()` if needed, for better clarity and compatibility with future versions. ```R unnest(df, x, y) ``` -------------------------------- ### Deprecated: unnest() `.drop` and `.preserve` arguments Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/unnest.md The `.drop` and `.preserve` arguments in `unnest()` are deprecated. All list-columns are now preserved by default, simplifying the preservation logic. ```R unnest(df, x, .preserve = y) ``` ```R unnest(df, x, .drop = FALSE) ``` -------------------------------- ### healthyR.ai Package Check Results (Devel) Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output indicates a successful package check for healthyR.ai in development mode, with a 'Status: OK' message. ```text * using log directory ‘/tmp/workdir/healthyR.ai/new/healthyR.ai.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘healthyR.ai/DESCRIPTION’ ... OK * this is package ‘healthyR.ai’ version ‘0.0.11’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK ... * checking examples ... OK * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking running R code from vignettes ... NONE ‘auto-kmeans.Rmd’ using ‘UTF-8’... OK ‘getting-started.Rmd’ using ‘UTF-8’... OK ‘kmeans-umap.Rmd’ using ‘UTF-8’... OK * checking re-building of vignette outputs ... OK * DONE Status: OK ``` -------------------------------- ### Control output column name with .key Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/nest.md The .key argument can be used to control the output column name when using the old interface of nest(). A warning is issued if the name is not explicitly provided. ```R out <- nest(df, y = y, .key = "y") ``` -------------------------------- ### Expand data frame with unique values using expand() Source: https://context7.com/tidyverse/tidyr/llms.txt Use `expand()` to create all combinations of values from specified columns. `nesting()` can be used to only include observed pairs. ```R fruits <- tibble(type = c("apple","orange","apple"), year = c(2010,2010,2012)) fruits |> expand(type, year) # all type × year combos ``` ```R fruits |> expand(nesting(type, year)) # only observed pairs ``` -------------------------------- ### Repairing duplicate names with `names_repair = "unique"` Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/unnest-wider.md Demonstrates how to use the `names_repair = "unique"` argument to automatically resolve duplicate inner names by appending suffixes. ```R out <- unnest_wider(df, col, names_repair = "unique") ``` -------------------------------- ### Validate .key in nest() Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/nest.md The .key argument in nest() must be a single string. Providing a number will result in an error. ```R nest(df, y = ya:yb, .key = 1) ``` -------------------------------- ### Deprecated: unnest() `.sep` argument Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/unnest.md The `.sep` argument in `unnest()` is deprecated. Use `names_sep` instead for specifying separators between column names when unnesting. ```R out <- unnest(df, c(x, y), .sep = "_") ``` -------------------------------- ### expand_grid() controls name_repair Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/expand.md Illustrates how `expand_grid()` can repair duplicate column names using the `.name_repair` argument. ```R out <- expand_grid(x = x, x = x, .name_repair = "unique") ``` -------------------------------- ### Error: `build_wider_spec()` requires empty dots Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-wide.md Ensures that the ellipsis `...` argument in `build_wider_spec()` is empty. Any arguments passed to `...` will cause an error. ```R build_wider_spec(df, 1) ``` ```R build_wider_spec(df, name_prefix = "") ``` -------------------------------- ### Generate combinations with fastest variation Source: https://context7.com/tidyverse/tidyr/llms.txt Modify the variation order in `expand_grid` by setting `.vary = "fastest"` to make the first vector vary fastest, similar to base R's `expand.grid()` behavior. ```r # Vary the first column fastest (like base::expand.grid) expand_grid(x = 1:3, y = 1:2, .vary = "fastest") ``` -------------------------------- ### pack() input validation Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pack.md Illustrates the input validation checks performed by pack(). It ensures that the data input is a data frame and that all arguments passed to pack() are named. ```R pack(1) ``` ```R pack(df, c(a1, a2), c(b1, b2)) ``` ```R pack(df, a = c(a1, a2), c(b1, b2)) ``` ```R pack(df, a = c(a1, a2), .names_sep = 1) ``` -------------------------------- ### expand_grid() validates .vary parameter Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/expand.md Demonstrates `expand_grid()`'s validation for the `.vary` parameter, showing an error for an invalid value. ```R expand_grid(x = 1:2, y = 1:2, .vary = "invalid") ``` -------------------------------- ### Error: Cannot mix indices_to with indices_include = FALSE Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/unnest-longer.md This error arises when attempting to use both `indices_to` to specify an index column name and `indices_include = FALSE` to exclude index columns simultaneously, which is a conflicting configuration. ```R unnest_longer(mtcars, mpg, indices_to = "x", indices_include = FALSE) ``` -------------------------------- ### Complete data frame with observed combinations Source: https://context7.com/tidyverse/tidyr/llms.txt Use `complete` with `nesting()` to create rows only for combinations of specified columns that are already present in the data. This avoids generating combinations that don't exist in the original data. ```r df <- tibble( group = c(1:2, 1, 2), item_id = c(1:2, 2, 3), item_name = c("a", "a", "b", "b"), value1 = c(1, NA, 3, 4), value2 = 4:7 ) # Only combinations of (item_id, item_name) that actually exist, # crossed with all values of group df |> complete(group, nesting(item_id, item_name)) ``` -------------------------------- ### Create all combinations of vectors using crossing() Source: https://context7.com/tidyverse/tidyr/llms.txt Use `crossing()` to create a data frame with all combinations of the supplied vectors. It is equivalent to `expand_grid` but de-duplicates and sorts the results. ```R crossing(x = c(1, 1, 2), y = c("a", "b")) ``` -------------------------------- ### Handling duplicated keys with list columns and warnings Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-wide.md When `pivot_wider` encounters duplicated keys in the data, it produces list columns by default and issues a warning. The warning suggests using `values_fn = list` to suppress it or `values_fn = {summary_fun}` to summarize duplicates. ```R pv <- pivot_wider(df, names_from = key, values_from = val) ``` -------------------------------- ### Error: `col` is absent but must be supplied Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/unnest-wider.md The `col` argument, specifying the column to unnest, must be provided to the `unnest_wider` function. Omitting it will cause this error. ```R unnest_wider(df) ``` -------------------------------- ### Warn about old interface without names Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/nest.md Using the old interface of nest() with unnamed expressions in ... generates a warning, suggesting explicit naming for clarity. ```R out <- nest(df, y) ``` ```R out <- nest(df, -y) ``` -------------------------------- ### ggstatsplot Package Check Results (Devel) Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md This output summarizes the package check for ggstatsplot in development. It indicates a NOTE status, suggesting potential issues but not a hard failure. ```text * using log directory ‘/tmp/workdir/ggstatsplot/new/ggstatsplot.Rcheck’ * using R version 4.1.1 (2021-08-10) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘ggstatsplot/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘ggstatsplot’ version ‘0.10.0’ * package encoding: UTF-8 * checking package namespace information ... OK ... Running ‘spelling.R’ Running ‘testthat.R’ * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking running R code from vignettes ... NONE ‘additional.Rmd’ using ‘UTF-8’... OK ‘ggstatsplot.Rmd’ using ‘UTF-8’... OK * checking re-building of vignette outputs ... OK * DONE Status: 1 NOTE ``` -------------------------------- ### Validating .by columns in fill() Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/fill.md When using the `.by` argument in `fill()`, all specified columns must exist in the data frame. Selecting non-existent columns will cause an error. ```R fill(df, y, .by = z) ``` -------------------------------- ### Error when multiple ... supplied to pivot_wider Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-wide.md Shows the error when multiple unnamed arguments are passed via `...` to `pivot_wider`. ```r pivot_wider(df, id, id2) ``` -------------------------------- ### Combine columns and remove NAs Source: https://context7.com/tidyverse/tidyr/llms.txt When using `unite`, set `na.rm = TRUE` to silently drop NA values instead of including them as the string "NA" in the combined column. This can result in empty strings if all values in a row are NA. ```r df <- expand_grid(x = c("a", NA), y = c("b", NA)) # Drop NAs silently instead of including "NA" df |> unite("z", x:y, na.rm = TRUE, remove = FALSE) ``` -------------------------------- ### unpack() handles inner name duplication Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pack.md Shows how unpack() detects and reports duplicated names within columns being unpacked. It suggests using `names_sep` or `names_repair` to resolve these conflicts. ```R unpack(df, c(x, y)) ``` ```R unpack(df, c(x, y, z)) ``` -------------------------------- ### Error: `pivot_wider_spec()` requires empty dots Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pivot-wide.md Ensures that the ellipsis `...` argument in `pivot_wider_spec()` is empty. Any arguments passed to `...` will cause an error. ```R pivot_wider_spec(df, spec, 1) ``` ```R pivot_wider_spec(df, spec, name_repair = "check_unique") ``` -------------------------------- ### Disallowing .by with grouped data frames in fill() Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/fill.md The `.by` argument cannot be used when the input data frame is already grouped. Use `group_by()` and `fill()` separately or consider alternative approaches. ```R fill(df, y, .by = x) ``` -------------------------------- ### R Package Dependency Check Error Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md Indicates that a required package ('loon' in this case) is not available during the dependency check for 'loon.ggplot'. ```text * checking package dependencies ... ERROR Package required but not available: ‘loon’ Package suggested but not available for checking: ‘zenplots’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. * DONE Status: 1 ERROR ``` -------------------------------- ### R Package Dependency Check Note Source: https://github.com/tidyverse/tidyr/blob/main/revdep/failures.md Indicates a NOTE during the package dependency check for 'marginaleffects', suggesting potential issues that are not critical errors. ```text * checking package dependencies ... NOTE ... ``` -------------------------------- ### unpack() input validation Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/pack.md Shows the input validation checks for unpack(). It verifies that the primary data input is a data frame, that the columns to unpack are specified, and that `names_sep` is a string or NULL. ```R unpack(1) ``` ```R unpack(df) ``` ```R unpack(df, y, names_sep = 1) ``` -------------------------------- ### Validate .names_sep in nest() Source: https://github.com/tidyverse/tidyr/blob/main/tests/testthat/_snaps/nest.md The .names_sep argument in nest() must be a single string or NULL. Providing a number will result in an error. ```R nest(df, y = ya:yb, .names_sep = 1) ```