The line (#34) destfile = paste0(tempdir(), "AAC_codes.dbf") is wrong because it won't insert the necessary system delimiter. All args should simply be passed to file.path, and not paste0. At it stands, this creates the .dbf file one directory up from tempdir(), with a name that is a mash of the last part of tempdir() plus the desired file name, so the function works but not really as intended. Critically, it creates a file outside the tempdir() of the current env, so will fail on any systems on which users do not have permission to do that!
See: https://github.com/ropensci/onboarding/issues/121#issuecomment-310839849