utility to show dir_tree of available files in testdata folders See list of samples of input files to try in EJAM, and output examples from EJAM functions
Source:R/testdata.R
testdata.Rd
utility to show dir_tree of available files in testdata folders See list of samples of input files to try in EJAM, and output examples from EJAM functions
Arguments
- pattern
optional query expression, used as regexp passed to
fs::dir_ls()
- installed
If you are a developer who has the local source package, you can set this parameter to FALSE if you want to work with the local source package version of the testdata folders rather than the locally installed version.
- quiet
set TRUE if you want to just get the path without seeing all the info in console and without browsing to the folder
Examples
testdata('shapes', quiet = T)
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland.gdb
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland.gdb.zip
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland.json
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland.kml
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland_folder_shp
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland_folder_shp.zip
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland_shp.zip
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/stations.zip
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/stations_shp.zip
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/testshapes_2.zip
x <- testdata('shape', quiet = TRUE)
x[fs::is_file(x)]
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland.gdb.zip
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland.json
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland.kml
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland_folder_shp.zip
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/portland_shp.zip
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/stations.zip
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/stations_shp.zip
#> /home/runner/work/_temp/Library/EJAM/testdata/shapes/testshapes_2.zip
testdata('fips', quiet = T)
#> /home/runner/work/_temp/Library/EJAM/testdata/fips
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/cities_2.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/counties_in_AL_detailed.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/counties_in_Alabama.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/counties_in_Delaware.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/counties_in_Delaware_invalid.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/county_10.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/county_100.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/county_1000.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/county_state_300.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/state_10.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/state_50.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/state_county_tract_10.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/tract_10.csv
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/tract_100.csv
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/tract_1000.csv
#> /home/runner/work/_temp/Library/EJAM/testdata/fips/tract_state_285.xlsx
testdata('registryid', quiet = T)
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/ECHO_Test_Data
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/FRS_example_data.CSV
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/FRS_example_data.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_test_regid_8.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_10.csv
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_10.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_100.csv
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_100.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_1000.csv
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_1000.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_10000.csv
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_10000.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_100000.csv
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_100000.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/frs_testpoints_3_duplicated_id.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/registryid/testinput_registry_id_8.xlsx
testdata("address", quiet = T)
#> /home/runner/work/_temp/Library/EJAM/testdata/address
#> /home/runner/work/_temp/Library/EJAM/testdata/address/testinput_address_table.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/address/testinput_address_table_9.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/address/testinput_address_table_goodnames.xlsx
#> /home/runner/work/_temp/Library/EJAM/testdata/address/testinput_address_table_withfull.xlsx
# datasets as lazyloaded objects vs. files installed with package
topic = "fips" # or "shape" or "latlon" or "naics" or "address" etc.
# datasets / R objects
cbind(data.in.package = sort(grep(topic, EJAM:::datapack()$Item, value = T)))
#> Get more info with datapack(simple = FALSE)
#>
#> ignoring sortbysize because simple=TRUE
#>
#> data.in.package
#> [1,] "testinput_fips_blockgroups"
#> [2,] "testinput_fips_cities"
#> [3,] "testinput_fips_counties"
#> [4,] "testinput_fips_states"
#> [5,] "testinput_fips_tracts"
# files
cbind(files.in.package = sort(basename(testdata(topic, quiet = T))))
#> files.in.package
#> [1,] "cities_2.xlsx"
#> [2,] "counties_in_AL_detailed.xlsx"
#> [3,] "counties_in_Alabama.xlsx"
#> [4,] "counties_in_Delaware.xlsx"
#> [5,] "counties_in_Delaware_invalid.xlsx"
#> [6,] "county_10.xlsx"
#> [7,] "county_100.xlsx"
#> [8,] "county_1000.xlsx"
#> [9,] "county_state_300.xlsx"
#> [10,] "fips"
#> [11,] "state_10.xlsx"
#> [12,] "state_50.xlsx"
#> [13,] "state_county_tract_10.xlsx"
#> [14,] "tract_10.csv"
#> [15,] "tract_100.csv"
#> [16,] "tract_1000.csv"
#> [17,] "tract_state_285.xlsx"