knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(dht)
greeting( geomarker_name = "roads", version = "0.1", description = "calculates proximity and length of nearby major roadways" )
(Here we supplied values to use in the greeting, but from inside a DeGAUSS container these will be automatically picked up based on the environment variables that capture metadata using just dht::greeting()
.)
(d <- read_lat_lon_csv('../tests/testthat/my_address_file_geocoded.csv', sf = T, project_to_crs = 5072))
Returns a list with two elements -- the raw data and tibble nested on row (to prevent calculations with duplicate lat/lon).
check_for_column(d, 'lat', d$lat)
Nothing is returned if the column is present. An error is thrown if the column is not present.
check_for_column(d, "nope", d$lat)
check_for_column(d, 'lat', d$lat, 'numeric')
Again, nothing is returned if the column type matches the desired type. A warning is displayed if the column type does not match the desired type.
check_for_column(d, 'lat', d$lat, 'character')
check_dates(c('1/1/21', '1/2/21', '1/3/21'))
If dates are in slash (1/1/21) or ISO (2021-01-01) format, they are returned in ISO format. If dates are in another format, a helpful error message is generated.
check_dates(c('1/1/2021', '1/2/2021', '1/3/2021'))
Unnests the tibble created with read_lat_lon_csv()
and merges back to raw data, then writes the output csv with container name and version appended to filename.
write_geomarker_file(d = d, raw_data = d, filename = 'tests/my_address_file_geocoded.csv', geomarker_name = 'roads', version = '0.1')
From inside of a DeGAUSS container, where the environment variables that capture metadata are available, this can be accomplished with just:
write_geomarker_file(d = d, raw_data = d, filename = opt$filename)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.