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 FAOSTAT
FAO.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 performed
OK
(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] FAOSTAT Alisson Lucrécio via R-br

Responder a