tests/testthat/_snaps/readme.md

readme examples

Code
  xnew_data(obs_data)
Output
  # A tibble: 1 x 9
    lgl     int   dbl chr   fct     ord      dte        dtt                 hms   
    <lgl> <int> <dbl> <chr> <fct>   <ord>    <date>     <dttm>              <time>
  1 FALSE     3  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
Code
  xnew_data(obs_data, int)
Output
  # A tibble: 6 x 9
    lgl     int   dbl chr   fct     ord      dte        dtt                 hms   
    <lgl> <int> <dbl> <chr> <fct>   <ord>    <date>     <dttm>              <time>
  1 FALSE     1  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  2 FALSE     2  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  3 FALSE     3  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  4 FALSE     4  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  5 FALSE     5  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  6 FALSE     6  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
Code
  xnew_data(obs_data, xnew_seq(int, length_out = 3))
Output
  # A tibble: 3 x 9
    lgl     int   dbl chr   fct     ord      dte        dtt                 hms   
    <lgl> <int> <dbl> <chr> <fct>   <ord>    <date>     <dttm>              <time>
  1 FALSE     1  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  2 FALSE     3  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  3 FALSE     6  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
Code
  xnew_data(obs_data, xnew_seq(int, length_out = 3, obs_only = TRUE))
Output
  # A tibble: 3 x 9
    lgl     int   dbl chr   fct     ord      dte        dtt                 hms   
    <lgl> <int> <dbl> <chr> <fct>   <ord>    <date>     <dttm>              <time>
  1 FALSE     1  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  2 FALSE     4  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  3 FALSE     6  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
Code
  xnew_data(obs_data, int, fct)
Output
  # A tibble: 18 x 9
     lgl     int   dbl chr   fct      ord    dte        dtt                 hms   
     <lgl> <int> <dbl> <chr> <fct>    <ord>  <date>     <dttm>              <time>
   1 FALSE     1  4.57 most  not obs  a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
   2 FALSE     1  4.57 most  a rarity a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
   3 FALSE     1  4.57 most  most     a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
   4 FALSE     2  4.57 most  not obs  a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
   5 FALSE     2  4.57 most  a rarity a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
   6 FALSE     2  4.57 most  most     a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
   7 FALSE     3  4.57 most  not obs  a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
   8 FALSE     3  4.57 most  a rarity a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
   9 FALSE     3  4.57 most  most     a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
  10 FALSE     4  4.57 most  not obs  a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
  11 FALSE     4  4.57 most  a rarity a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
  12 FALSE     4  4.57 most  most     a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
  13 FALSE     5  4.57 most  not obs  a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
  14 FALSE     5  4.57 most  a rarity a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
  15 FALSE     5  4.57 most  most     a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
  16 FALSE     6  4.57 most  not obs  a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
  17 FALSE     6  4.57 most  a rarity a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
  18 FALSE     6  4.57 most  most     a rar~ 1970-01-04 1969-12-31 16:00:03 00'03"
Code
  xnew_data(obs_data, xobs_only(int, fct))
Output
  # A tibble: 3 x 9
    lgl     int   dbl chr   fct      ord     dte        dtt                 hms   
    <lgl> <int> <dbl> <chr> <fct>    <ord>   <date>     <dttm>              <time>
  1 FALSE     1  4.57 most  most     a rari~ 1970-01-04 1969-12-31 16:00:03 00'03"
  2 FALSE     4  4.57 most  most     a rari~ 1970-01-04 1969-12-31 16:00:03 00'03"
  3 FALSE     6  4.57 most  a rarity a rari~ 1970-01-04 1969-12-31 16:00:03 00'03"
Code
  xnew_data(obs_data, new = c(TRUE, FALSE))
Output
  # A tibble: 2 x 10
    lgl     int   dbl chr   fct     ord      dte        dtt                 hms   
    <lgl> <int> <dbl> <chr> <fct>   <ord>    <date>     <dttm>              <time>
  1 FALSE     3  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  2 FALSE     3  4.57 most  not obs a rarity 1970-01-04 1969-12-31 16:00:03 00'03"
  # i 1 more variable: new <lgl>


poissonconsulting/newdata documentation built on Jan. 18, 2024, 1:30 a.m.