boyiguo1 / Tutorial-Residential_Segregation_Score

A tutorial & reproducible example on calculating residential segregation indices with decennial US census data (Version 1-0-0)
MIT License
14 stars 0 forks source link

configuration residential segregation #9

Open datscience17 opened 2 years ago

datscience17 commented 2 years ago

When pulling census data, if I want to create scores for the entire country, how do I configuration with tar_target?

boyiguo1 commented 2 years ago

Hi @datscience17,

Thanks for your question.

In the repository, we provided other examples to construct the scores for multiple states of interest or the states via different branches of the repository. You can find these examples via

More importantly, you will need to check out the _targets.R file. When creating the scores for multiple areal units, we use implicit loops (see pattern=map(states) in the tar_target function) to iterate over all areas of interest. This implicit looping is implemented with the dynamic programming feature in the workflow package targets.

In addition, you need to configure which states are of interest by supplying a vector of state names to the tar_target(states, state_names_vec). For example, you can pass in

Of course, you’ll need to use the version of _targets.R with the implicit loop.