knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(usincometaxes)
usincometaxes
sends data to the National Bureau of Economic Research's (NBER) TAXSIM 35 server. The data must meet TAXSIM 35's requirements for data types and column names. usincometaxes
performs checks to ensure the data will be accepted by TAXSIM 35. It's possible, however, that issues will slip through. This can produce cryptic errors that might be hard to location. If you receive errors that you cannot correct it could be helpful to manually upload your data to TAXSIM 35's servers.
usincometaxes
provides a function, create_dataset_for_taxsim()
, to format your data for manual uploading. To use the function, prepare your dataset as you normally would to use taxsim_calculate_taxes()
. For example, follow the formatting required for input columns. Then, supply the dataset to create_dataset_for_taxsim()
.
data(taxpayer_finances) taxsim_dataset <- create_dataset_for_taxsim(taxpayer_finances) knitr::kable(head(taxsim_dataset))
Then, save this dataset as a csv file to your local computer. It is recommended to use readr::read_csv()
to write out the dataset. write.csv
tends to pose issues. Also note that you can name the .csv
file anything you wish.
taxsim_filename <- 'taxsim_dataset.csv' vroom::vroom_write(taxsim_dataset, taxsim_filename)
Now, manually upload the file taxsim_dataset.csv
to TAXSIM 35's server by going to (https://taxsim.nber.org/taxsim35/), navigating to the section titled 'OR...Upload a (not too large) file with TAXSIM data:', and uploading the .csv
file:
Errors from the manual upload could guide you in solving any data formatting issues.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.