This function formats a data frame so it can be used with
build_bmap
, build_gmap
, build_pmap
,
build_bkey
and build_gkey
.
read.uv(data = NULL, file = NULL, estimate, error, exceedance)
A data frame.
A CSV file pathway.
Name of estimate column.
Name of error column.
Name of exceedance probability column.
Estimates and errors must be in the first and second columns of a data frame
for build_bmap
, build_gmap
,
build_pmap
, build_emap
,
build_bkey
and build_gkey
. read.uv
provides an automated way to
format a data frame already loaded in R or to import a CSV file as a data
frame and arrange the columns correctly.
data(us_data)
poverty <- read.uv(data = us_data, estimate = "pov_rate", error = "pov_moe")
head(poverty)
#> pov_rate pov_moe GEO_ID GEO.id2 GEO.display.label
#> 1 9.3 1.9 0500000US01001 1001 Autauga County, Alabama
#> 2 9.6 1.1 0500000US01003 1003 Baldwin County, Alabama
#> 3 19.5 2.8 0500000US01005 1005 Barbour County, Alabama
#> 4 12.8 4.4 0500000US01007 1007 Bibb County, Alabama
#> 5 12.3 2.0 0500000US01009 1009 Blount County, Alabama
#> 6 22.7 6.5 0500000US01011 1011 Bullock County, Alabama