Note: This article is a work in progress
EXAMPLES OF FILES & TEST DATA EJAM CAN IMPORT OR OUTPUT
Sample spreadsheets & shapefiles for trying the web app
Examples of .xlsx files and shapefiles are installed locally with EJAM, as input files you can use to try out EJAM functions or the web app, or to see what an input file should look like.
Files and Datasets Installed with EJAM
For just one topic you can see all files and data objects like this:
topic = "fips" # or "shape" or "latlon" or "naics" or "address" etc.
# datasets / R objects
cbind(data.in.package = sort(grep(topic, EJAM:::pkg_data()$Item, value = T)))
#> Get more info with pkg_data(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_mix"
#> [5,] "testinput_fips_states"
#> [6,] "testinput_fips_tracts"
#> [7,] "testoutput_ejamit_fips_cities"
#> [8,] "testoutput_ejamit_fips_counties"
# 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_invalid.xlsx"
#> [5,] "counties_in_Delaware.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,] "testoutput_ejam2excel_fips_cities.xlsx"
#> [15,] "testoutput_ejam2excel_fips_counties.xlsx"
#> [16,] "testoutput_ejam2report_fips_cities.html"
#> [17,] "testoutput_ejam2report_fips_counties.html"
#> [18,] "testoutput_ejam2report_fips_counties.pdf"
#> [19,] "tract_10.csv"
#> [20,] "tract_100.csv"
#> [21,] "tract_1000.csv"
#> [22,] "tract_state_285.xlsx"Local folders with sample files
The best, simplest way to see all these files is the function called testdata()
You can try uploading these kinds of files in the web app, for example, by finding them in these local folders where you installed the package:
- /
EJAM/testdata/latlon/testpoints_100.xlsx - /
EJAM/testdata/shapes/portland_shp.zip - etc.
To open the locally installed “testdata” folders (in Windows File Explorer, or MacOS Finder)
Example of using a file in EJAM
testpoint_files <- list.files(
system.file("testdata/latlon", package = "EJAM"),
full.names = T
)
testpoint_files
latlon_from_anything(testpoint_files[2]) Sample R data objects: Examples of inputs & outputs of EJAM functions
The package has a number of data objects, installed as part of EJAM and related packages, that are examples of inputs or intermediate data objects that you can use to try out EJAM functions, or you may just want to see what the outputs and inputs look like, or you could use them for testing purposes.
For documentation on each input or output item (R object), see reference documentation on each object
This code snippet provides a useful list of test/ sample data objects in EJAM and related packages:
POINT DATA (LAT/LON COORDINATES) for testing
ejamit(), mapfast(),
getblocksnearby(), etc.
See all files and all dataset examples related to one topic:
topic = "fips"
cbind(data.in.package = sort(grep(topic, EJAM:::pkg_data()$Item, value = T)))
cbind(files.in.package = sort(basename(testdata(topic, quiet = T))))
x[grepl("^testp", x$Item), ]
#> Package Item
#> 148 EJAM testpoints_10
#> 168 EJAM testpoints_100
#> 169 EJAM testpoints_100_dt
#> 184 EJAM testpoints_1000
#> 197 EJAM testpoints_10000
#> 149 EJAM testpoints_5
#> 165 EJAM testpoints_50
#> 176 EJAM testpoints_500
#> 141 EJAM testpoints_bad
#> 142 EJAM testpoints_overlap3
#> Title
#> 148 test points data.frame with columns sitenumber, lat, lon
#> 168 test points data.frame with columns sitenumber, lat, lon
#> 169 test points data.frame with columns sitenumber, lat, lon
#> 184 test points data.frame with columns sitenumber, lat, lon
#> 197 test points data.frame with columns sitenumber, lat, lon
#> 149 test points data.frame with columns sitenumber, lat, lon
#> 165 test points data.frame with columns sitenumber, lat, lon
#> 176 test points data.frame with columns sitenumber, lat, lon
#> 141 test points data.frame with columns note, lat, lon
#> 142 test points data.frame with columns note, lat, lonSTREET ADDRESSES for testing geocoding in
latlon_from_address() etc.
x[grepl("^test_", x$Item), ]
#> [1] Package Item Title
#> <0 rows> (or 0-length row.names)
cat("\n\n")FACILITY REGISTRY IDs for testing
latlon_from_regid() etc.
x[grepl("^test[^op_]", x$Item), ]
#> Package Item
#> 146 EJAM testinput_address_2
#> 152 EJAM testinput_address_9
#> 147 EJAM testinput_address_parts
#> 159 EJAM testinput_address_table
#> 166 EJAM testinput_address_table_9
#> 160 EJAM testinput_address_table_goodnames
#> 161 EJAM testinput_address_table_withfull
#> 132 EJAM testinput_fips_blockgroups
#> 61 EJAM testinput_fips_cities
#> 62 EJAM testinput_fips_counties
#> 63 EJAM testinput_fips_mix
#> 64 EJAM testinput_fips_states
#> 133 EJAM testinput_fips_tracts
#> 65 EJAM testinput_mact
#> 66 EJAM testinput_naics
#> 67 EJAM testinput_program_name
#> 162 EJAM testinput_program_sys_id
#> 68 EJAM testinput_regid
#> 69 EJAM testinput_registry_id
#> 173 EJAM testinput_shapes_2
#> 70 EJAM testinput_sic
#> 172 EJAM testshapes_2
#> Title
#> 146 datasets for trying address-related functions
#> 152 datasets for trying address-related functions
#> 147 datasets for trying address-related functions
#> 159 datasets for trying address-related functions
#> 166 datasets for trying address-related functions
#> 160 datasets for trying address-related functions
#> 161 datasets for trying address-related functions
#> 132 testinput_fips_blockgroups dataset
#> 61 testinput_fips_cities dataset
#> 62 testinput_fips_counties dataset
#> 63 testinput_fips_mix dataset
#> 64 testinput_fips_states dataset
#> 133 testinput_fips_tracts dataset
#> 65 testinput_mact dataset
#> 66 testinput_naics dataset
#> 67 testinput_program_name dataset
#> 162 test data, EPA program system ID numbers to try using
#> 68 test data, EPA Facility Registry ID numbers to try using
#> 69 test data, EPA Facility Registry ID numbers to try using
#> 173 testinput_shapes_2 dataset
#> 70 testinput_sic dataset
#> 172 testshapes_2 dataset
cat("\n\n")EXAMPLES OF OUTPUTS from ejamit(),
getblocksnearby(), etc., you can use as inputs to
ejam2report(), ejam2excel(),
ejam2ratios(), ejam2barplot(),
doaggregate(), etc.
x[grepl("^testout", x$Item), ]
#> Package Item
#> 208 EJAM testoutput_doaggregate_1000pts_1miles
#> 202 EJAM testoutput_doaggregate_100pts_1miles
#> 193 EJAM testoutput_doaggregate_10pts_1miles
#> 209 EJAM testoutput_ejamit_1000pts_1miles
#> 203 EJAM testoutput_ejamit_100pts_1miles
#> 198 EJAM testoutput_ejamit_10pts_1miles
#> 200 EJAM testoutput_ejamit_fips_cities
#> 201 EJAM testoutput_ejamit_fips_counties
#> 195 EJAM testoutput_ejamit_shapes_2
#> 205 EJAM testoutput_getblocksnearby_1000pts_1miles
#> 191 EJAM testoutput_getblocksnearby_100pts_1miles
#> 183 EJAM testoutput_getblocksnearby_10pts_1miles
#> Title
#> 208 test output of doaggregate()
#> 202 test output of doaggregate()
#> 193 test output of doaggregate()
#> 209 test output of ejamit()
#> 203 test output of ejamit()
#> 198 test output of ejamit()
#> 200 testoutput_ejamit_fips_cities dataset
#> 201 testoutput_ejamit_fips_counties dataset
#> 195 testoutput_ejamit_shapes_2 dataset
#> 205 test output of getblocksnearby(), and is an input to doaggregate()
#> 191 test output of getblocksnearby(), and is an input to doaggregate()
#> 183 test output of getblocksnearby(), and is an input to doaggregate()
cat("\n\n")LARGE DATASETS USED BY THE PACKAGE
Note that the largest files used by the package are mostly the block-related datasets with info about population size and location of US blocks, the facility datasets with info about EPA-regulated sites, and the blockgroup-related datasets with EJSCREEN indicators.
Some datasets get downloaded by the package at installation or launch or as needed. See the article on Updating EJAM Datasets for more information on these.
Also see reference documentation for each dataset.