To make calls to the census geocoder api I am using tips from the documentation found at http://geocoding.geo.census.gov/geocoder/Geocoding_Services_API.pdf under the heading "Batch Geocoding". The shell command they give for calling the api for a batch is
curl --form addressFile=@address.csv --form benchmark=4 http://geocoding.geo.census.gov/geocoder/locations/addressbatch --output geocoderesult.csv
where address.csv is the file to be uploaded.
This works perfectly. However, I would like to create an R script to make the whole process automated.
What would be an equivalent way to do the above command in R? Could postForm() in the RCurl package accomplish this?
BTW, each line of the csv file getting uploaded ("address.csv") must be of the form
Unique ID, Street address, City, State, ZIP
So, for example, it could just contain addresses for Apple and Facebook like
1, 1 Infinite Loop, Cupertino, CA, 95014
2, 1 Hacker Way, Menlo Park, CA, 94025
Thanks!