UTILITY - DRAFT - See names and size of data sets in installed package(s) - internal utility function
Source:R/utils_datapack.R
datapack.Rd
Wrapper for data() and can get memory size of objects
Arguments
- pkg
a character vector giving the package(s) to look in for data sets
- len
Only affects what is printed to console - specifies the number of characters to limit Title to, making it easier to see in the console.
- sortbysize
if TRUE (and simple=F), sort by increasing size of object, within each package, not alpha.
- simple
FALSE to get object sizes, etc., or TRUE to just get names in each package, like
data(package = "EJAM")$results[, c("Package", 'Item')]
Details
do not rely on this much - it was a quick utility. It may create and leave objects in global envt - not careful about that.
See also
dataset_pkgdown_yaml_check()
If simple = FALSE, data.frame with colnames Package, Item, size, Title.Short
Examples
# see just a vector of the data object names
data(package = "EJAM")$results[, 'Item']
#> [1] "NAICS"
#> [2] "SIC"
#> [3] "avg.in.us"
#> [4] "bg_cenpop2020"
#> [5] "bgpts"
#> [6] "blockgroupstats"
#> [7] "censusplaces"
#> [8] "custom"
#> [9] "default_points_shown_at_startup"
#> [10] "ejamdata_version"
#> [11] "ejampackages"
#> [12] "ejscreenRESTbroker2table_na_filler"
#> [13] "epa_programs"
#> [14] "epa_programs_defined"
#> [15] "formulas_all"
#> [16] "formulas_d"
#> [17] "frsprogramcodes"
#> [18] "high_pctiles_tied_with_min"
#> [19] "islandareas"
#> [20] "lat_alias"
#> [21] "lon_alias"
#> [22] "mact_table"
#> [23] "map_headernames"
#> [24] "metadata4pins"
#> [25] "meters_per_mile"
#> [26] "naics_counts"
#> [27] "naicstable"
#> [28] "names_age"
#> [29] "names_age_count"
#> [30] "names_all"
#> [31] "names_all_r"
#> [32] "names_climate"
#> [33] "names_climate_avg"
#> [34] "names_climate_pctile"
#> [35] "names_climate_state_avg"
#> [36] "names_climate_state_pctile"
#> [37] "names_community"
#> [38] "names_community_count"
#> [39] "names_countabove"
#> [40] "names_criticalservice"
#> [41] "names_criticalservice_avg"
#> [42] "names_criticalservice_pctile"
#> [43] "names_criticalservice_state_avg"
#> [44] "names_criticalservice_state_pctile"
#> [45] "names_d"
#> [46] "names_d_avg"
#> [47] "names_d_count"
#> [48] "names_d_demogindexstate"
#> [49] "names_d_extra"
#> [50] "names_d_extra_count"
#> [51] "names_d_language"
#> [52] "names_d_language_count"
#> [53] "names_d_languageli"
#> [54] "names_d_languageli_count"
#> [55] "names_d_other_count"
#> [56] "names_d_pctile"
#> [57] "names_d_ratio_to_avg"
#> [58] "names_d_ratio_to_state_avg"
#> [59] "names_d_state_avg"
#> [60] "names_d_state_pctile"
#> [61] "names_d_subgroups"
#> [62] "names_d_subgroups_alone"
#> [63] "names_d_subgroups_alone_avg"
#> [64] "names_d_subgroups_alone_count"
#> [65] "names_d_subgroups_alone_pctile"
#> [66] "names_d_subgroups_alone_ratio_to_avg"
#> [67] "names_d_subgroups_alone_ratio_to_state_avg"
#> [68] "names_d_subgroups_alone_state_avg"
#> [69] "names_d_subgroups_alone_state_pctile"
#> [70] "names_d_subgroups_avg"
#> [71] "names_d_subgroups_count"
#> [72] "names_d_subgroups_nh"
#> [73] "names_d_subgroups_nh_avg"
#> [74] "names_d_subgroups_nh_count"
#> [75] "names_d_subgroups_nh_pctile"
#> [76] "names_d_subgroups_nh_ratio_to_avg"
#> [77] "names_d_subgroups_nh_ratio_to_state_avg"
#> [78] "names_d_subgroups_nh_state_avg"
#> [79] "names_d_subgroups_nh_state_pctile"
#> [80] "names_d_subgroups_pctile"
#> [81] "names_d_subgroups_ratio_to_avg"
#> [82] "names_d_subgroups_ratio_to_state_avg"
#> [83] "names_d_subgroups_state_avg"
#> [84] "names_d_subgroups_state_pctile"
#> [85] "names_e"
#> [86] "names_e_avg"
#> [87] "names_e_other"
#> [88] "names_e_pctile"
#> [89] "names_e_ratio_to_avg"
#> [90] "names_e_ratio_to_state_avg"
#> [91] "names_e_state_avg"
#> [92] "names_e_state_pctile"
#> [93] "names_ej"
#> [94] "names_ej_pctile"
#> [95] "names_ej_state"
#> [96] "names_ej_state_pctile"
#> [97] "names_ej_supp"
#> [98] "names_ej_supp_pctile"
#> [99] "names_ej_supp_state"
#> [100] "names_ej_supp_state_pctile"
#> [101] "names_featuresinarea"
#> [102] "names_flag"
#> [103] "names_geo"
#> [104] "names_health"
#> [105] "names_health_avg"
#> [106] "names_health_count"
#> [107] "names_health_pctile"
#> [108] "names_health_ratio_to_avg"
#> [109] "names_health_ratio_to_state_avg"
#> [110] "names_health_state_avg"
#> [111] "names_health_state_pctile"
#> [112] "names_misc"
#> [113] "names_pct_as_fraction_blockgroupstats"
#> [114] "names_pct_as_fraction_ejamit"
#> [115] "names_pct_as_fraction_ejscreenit"
#> [116] "names_sitesinarea"
#> [117] "names_these"
#> [118] "names_these_avg"
#> [119] "names_these_ratio_to_avg"
#> [120] "names_these_ratio_to_state_avg"
#> [121] "names_these_state_avg"
#> [122] "names_wts"
#> [123] "namez"
#> [124] "sictable"
#> [125] "stateinfo"
#> [126] "stateinfo2"
#> [127] "states_shapefile"
#> [128] "statestats"
#> [129] "test_address_parts1"
#> [130] "test_address_table"
#> [131] "test_address_table_9"
#> [132] "test_address_table_goodnames"
#> [133] "test_address_table_withfull"
#> [134] "test_addresses2"
#> [135] "test_addresses_9"
#> [136] "test_regid"
#> [137] "test_xtrac"
#> [138] "testids_program_sys_id"
#> [139] "testids_registry_id"
#> [140] "testoutput_doaggregate_1000pts_1miles"
#> [141] "testoutput_doaggregate_100pts_1miles"
#> [142] "testoutput_doaggregate_10pts_1miles"
#> [143] "testoutput_ejamit_1000pts_1miles"
#> [144] "testoutput_ejamit_100pts_1miles"
#> [145] "testoutput_ejamit_10pts_1miles"
#> [146] "testoutput_ejscreenRESTbroker_1pts_1miles"
#> [147] "testoutput_ejscreenapi_1pts_1miles"
#> [148] "testoutput_ejscreenapi_plus_5"
#> [149] "testoutput_ejscreenit_10pts_1miles"
#> [150] "testoutput_ejscreenit_5"
#> [151] "testoutput_ejscreenit_50"
#> [152] "testoutput_ejscreenit_500"
#> [153] "testoutput_getblocksnearby_1000pts_1miles"
#> [154] "testoutput_getblocksnearby_100pts_1miles"
#> [155] "testoutput_getblocksnearby_10pts_1miles"
#> [156] "testpoints_10"
#> [157] "testpoints_100"
#> [158] "testpoints_1000"
#> [159] "testpoints_10000"
#> [160] "testpoints_100_dt"
#> [161] "testpoints_5"
#> [162] "testpoints_50"
#> [163] "testpoints_500"
#> [164] "testpoints_bad"
#> [165] "testpoints_overlap3"
#> [166] "testshapes_2"
#> [167] "usastats"
#> [168] "x_anyother"
# not actually sorted within each pkg by default
datapack()
#> Error in datapack(): could not find function "datapack"
# not actually sorted by default
datapack("EJAM")$Item
#> Error in datapack("EJAM"): could not find function "datapack"
##datapack("MASS", simple=T)
# sorted by size if simple=F
##datapack("datasets", simple=F)
x <- datapack(simple = F)
#> Error in datapack(simple = F): could not find function "datapack"
# sorted by size already, to see largest ones among all these pkgs:
tail(x[, 1:3], 20)
#> Error: object 'x' not found
# sorted alphabetically within each pkg
x[order(x$Package, x$Item), 1:2]
#> Error: object 'x' not found
# sorted alphabetically across all the pkgs
x[order(x$Item), 1:2]
#> Error: object 'x' not found