nplyr
nplyr copied to clipboard
Warnings not shown to user
library(nplyr)
library(tidyr)
library(dplyr)
#> Warning: package 'dplyr' was built under R version 4.2.3
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
# no deprecation warning shown to the user
gapminder::gapminder %>%
select(country, continent) %>%
nest(data = -continent) %>%
nest_left_join(data,
gapminder::gapminder,
by = "country")
#> # A tibble: 5 × 2
#> continent data
#> <fct> <list>
#> 1 Asia <tibble [4,752 × 6]>
#> 2 Europe <tibble [4,320 × 6]>
#> 3 Africa <tibble [7,488 × 6]>
#> 4 Americas <tibble [3,600 × 6]>
#> 5 Oceania <tibble [288 × 6]>
# deprecation warning
gapminder::gapminder %>%
select(country, continent) %>%
left_join(gapminder::gapminder,
by = "country")
#> Warning in left_join(., gapminder::gapminder, by = "country"): Detected an unexpected many-to-many relationship between `x` and `y`.
#> ℹ Row 1 of `x` matches multiple rows in `y`.
#> ℹ Row 1 of `y` matches multiple rows in `x`.
#> ℹ If a many-to-many relationship is expected, set `relationship =
#> "many-to-many"` to silence this warning.
#> # A tibble: 20,448 × 7
#> country continent.x continent.y year lifeExp pop gdpPercap
#> <fct> <fct> <fct> <int> <dbl> <int> <dbl>
#> 1 Afghanistan Asia Asia 1952 28.8 8425333 779.
#> 2 Afghanistan Asia Asia 1957 30.3 9240934 821.
#> 3 Afghanistan Asia Asia 1962 32.0 10267083 853.
#> 4 Afghanistan Asia Asia 1967 34.0 11537966 836.
#> 5 Afghanistan Asia Asia 1972 36.1 13079460 740.
#> 6 Afghanistan Asia Asia 1977 38.4 14880372 786.
#> 7 Afghanistan Asia Asia 1982 39.9 12881816 978.
#> 8 Afghanistan Asia Asia 1987 40.8 13867957 852.
#> 9 Afghanistan Asia Asia 1992 41.7 16317921 649.
#> 10 Afghanistan Asia Asia 1997 41.8 22227415 635.
#> # ℹ 20,438 more rows
Created on 2023-07-14 with reprex v2.0.2