Infelizmente o pacote FAOSTAT foi descontinuado. Veja a mensagem do autor:
NOTE: This package has been orphaned due to the current re-development of the 
FAOSTAT API and the fact that I no longer work for the organisation and has no 
access to the updates.

É melhor baixar a tabela inteira do site da FAO e sumarizar manualmente os 
dados no R - usar o pacote data.table é uma boa ideia para isso.
Saudações, -- Thiago V. dos Santos
Postdoctoral Research FellowDepartment of Climate and Space Science and 
EngineeringUniversity of Michigan 

    On Sunday, February 25, 2018, 9:58:31 PM EST, Alisson Lucrécio via R-br 
<[email protected]> wrote:  
 
 Caro Colegas,
Bom dia.
Tentei usar o pacote FAOSTAT para baixar dados da FAO, mas não funcionar. Eu 
acho que tem um erro no código arableLand ou domainCode.
Vocês saberiam o que eu poderia fazer para resolver esse erro?
Obrigado.
-- 
Alisson Lucrecio da Costa
--------------------------
library(FAOSTAT)
FAOquery.df = data.frame(varName = c("arableLand", "cerealExp", "cerealProd"),  
                       domainCode = c("RL", "TP", "QC"),                        
 itemCode = c(6621, 1944, 1717),                         elementCode = c(5110, 
5922, 5510),                         stringsAsFactors = FALSE)
## Download the data from FAOSTATFAO.lst = with(FAOquery.df,               
getFAOtoSYB(name = varName, domainCode = domainCode,                           
itemCode = itemCode, elementCode = elementCode,                           
useCHMT = TRUE, outputFormat = "wide"))FAO.lst$entity[, "arableLand"] = 
as.numeric(FAO.lst$entity[, "arableLand"])
--------------------------

library(FAOSTAT)> > FAOquery.df = data.frame(varName = c("arableLand", 
"cerealExp", "cerealProd"),+                          domainCode = c("RL", 
"TP", "QC"),+                          itemCode = c(6621, 1944, 1717),+         
                 elementCode = c(5110, 5922, 5510),+                          
stringsAsFactors = FALSE)> > ## Download the data from FAOSTAT> FAO.lst = 
with(FAOquery.df,+                getFAOtoSYB(name = varName, domainCode = 
domainCode,+                            itemCode = itemCode, elementCode = 
elementCode,+                            useCHMT = TRUE, outputFormat = "wide"))

                                                
----------------------------------------                                        
                                                        ** FAOSTAT Data 
Download (3 in Total) **                                                        
                                        
----------------------------------------                                        
        
(1): Downloading variable arableLand ... The specified query has no data, 
consult FAOSTAT (2): Downloading variable cerealExp ... NOTE: Multiple China 
detected in 'Value' sanitization is performedOK(3): Downloading variable 
cerealProd ... The specified query has no data, consult FAOSTAT 
 Number of variables successfully downloaded: 1 out of 3
> FAO.lst$entity[, "arableLand"] = as.numeric(FAO.lst$entity[, 
> "arableLand"])Error in `[.data.frame`(FAO.lst$entity, , "arableLand") :   
> undefined columns selected_______________________________________________
R-br mailing list
[email protected]
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forne�a c�digo 
m�nimo reproduz�vel.  
_______________________________________________
R-br mailing list
[email protected]
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forne�a c�digo 
m�nimo reproduz�vel.
  • [R-br] FAOSTAT Alisson Lucrécio via R-br
    • Re: [R-br] FAOSTAT Thiago V. dos Santos via R-br

Responder a