FAOSTATpackage icon indicating copy to clipboard operation
FAOSTATpackage copied to clipboard

Out of date API?

Open swood-ecology opened this issue 7 years ago • 1 comments

I'm having trouble pulling data from TM with the getFAOtoSYB(). I run the following search to get the appropriate TM codes:

FAOsearch() # 2; 3; 0; All; 4

I then pass the results to the getFAOtoSYB function:

getFAOtoSYB(query = .LastSearch)

I end up with the following errors:

getFAOtoSYB(query = .LastSearch)

                ------------------------------------------                     
                ** FAOSTAT Data Download (422 in Total) **                     
                ------------------------------------------                     

(1): Downloading variable Detailed trade matrix_Wool, hair waste_Import Quantity (tonnes) ... Error in faoData$FAOST_CODE : $ operator is invalid for atomic vectors [1] 1 Error : $ operator is invalid for atomic vectors [1] 2 Error : $ operator is invalid for atomic vectors [1] 3 Error : $ operator is invalid for atomic vectors [1] 4 ...

swood-ecology avatar Jun 30 '17 00:06 swood-ecology

See Filippo's commend in issue #23

I updated this gist which provides two functions

  1. download_faostat_bulk loads zip files from the FAOSTAT bulk download
  2. read_faostat_bulk reads the data in data frames.

paulrougieux avatar Aug 22 '17 09:08 paulrougieux