Linguagem R:Dataverse

De BrapciWiki
Ir para navegação Ir para pesquisar

Uso do R com o Dataverse

https://cran.r-project.org/web/packages/dataverse/vignettes/A-introduction.html

Install

# 1. Load Datavarse library  
library("dataverse")
# 2. Stored as an environment variable called DATAVERSE_KEY and copy the API TOKEN
Sys.setenv("DATAVERSE_KEY" = "numeros da chave")
# 3. Specifying the server installation
Sys.setenv("DATAVERSE_SERVER" = "dataverse.nutricao.ufrj.br")
# 4. Checking for "storageIdentifier" for each dataset
dataverse_search("Brazilian Consortium of Maternal and Child Nutrition (CONMAI)", per_page = 40,type = "dataset")[c("name", "type", 
"storageIdentifier", "name_of_dataverse")]

Script R

remotes::install_github("iqss/dataverse-client-r")
library("dataverse")
## Parametros
Sys.setenv("DATAVERSE_SERVER" = "https://vitrinedadosabertos.inep.rnp.br/")
Sys.setenv("DATAVERSE_KEY" = "examplekey12345")
##Busca
dataverse_search("censo")[c("name", "type", "description")]
## Mostra Arquivos do DataSet
ds <- get_dataset("doi:10.80102/vtn/FVBA0I")
ds
##
## Carga de um DataSet
gestor <- get_dataframe_by_name(
 "gestor_2020_final_GO.tab",
 "doi:10.80102/vtn/FVBA0I")
#mostra
summary(gestor)