Consistent wrapper around data() that forces the promise. This is also a stronger parallel to loading data from a file.

read_builtin(x, package = NULL)

Arguments

x

Name (character string) of data set to read.

package

Name of package from which to find data set. By default, all attached packages are searched and then the 'data' subdirectory (if present) of the current working directory.

Value

An object of the built-in class of x.

Examples

if (requireNamespace("dplyr")) { read_builtin("starwars", "dplyr") read_builtin("storms", "dplyr") }
#> Loading required namespace: dplyr
#> # A tibble: 10,010 × 13 #> name year month day hour lat long status category wind pressure #> <chr> <dbl> <dbl> <int> <dbl> <dbl> <dbl> <chr> <ord> <int> <int> #> 1 Amy 1975 6 27 0 27.5 -79 tropical d… -1 25 1013 #> 2 Amy 1975 6 27 6 28.5 -79 tropical d… -1 25 1013 #> 3 Amy 1975 6 27 12 29.5 -79 tropical d… -1 25 1013 #> 4 Amy 1975 6 27 18 30.5 -79 tropical d… -1 25 1013 #> 5 Amy 1975 6 28 0 31.5 -78.8 tropical d… -1 25 1012 #> 6 Amy 1975 6 28 6 32.4 -78.7 tropical d… -1 25 1012 #> 7 Amy 1975 6 28 12 33.3 -78 tropical d… -1 25 1011 #> 8 Amy 1975 6 28 18 34 -77 tropical d… -1 30 1006 #> 9 Amy 1975 6 29 0 34.4 -75.8 tropical s… 0 35 1004 #> 10 Amy 1975 6 29 6 34 -74.8 tropical s… 0 40 1002 #> # … with 10,000 more rows, and 2 more variables: ts_diameter <dbl>, #> # hu_diameter <dbl>