IQSS / dataverse-client-r

R Client for Dataverse Repositories
https://iqss.github.io/dataverse-client-r
61 stars 25 forks source link

Problema para recuperar informação pela API #122

Closed devmarcosanjos closed 2 years ago

devmarcosanjos commented 2 years ago

Estou com problemas de recuperar dados pela API no Dataverse

Detalhes: https://stackoverflow.com/questions/73131628/n%c3%a3o-foi-poss%c3%advel-recuperar-um-conjunto-de-dados-no-dataverse

Erro apresentado:

could not find function "get_dataframe_by_doi"
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Send failure: Connection was aborted
kuriwaki commented 2 years ago

What do you get when you run the following?

packageVersion("dataverse")

and if you run

?dataverse::get_dataframe_by_doi

Do you get a help page?

Finally what do you get when you run

Sys.getenv("DATAVERSE_SERVER")
devmarcosanjos commented 2 years ago
> packageVersion("dataverse")
[1] ‘0.3.11’
> Sys.getenv("DATAVERSE_SERVER")
[1] ""

Abre a documentação.

?dataverse::get_dataframe_by_doi
kuriwaki commented 2 years ago

It looks like you have the package and functions installed but you have not set a server. Every dataverse call needs to have specified which Dataverse (server) to look at. The main one is dataverse.harvard.edu, so you can set that for all your calls by editing your .Renviron or simply, each time, specify e.g.

dataverse::dataverse_search('Dados', server = "dataverse.harvard.edu")

This example works for me. There is more info on servers in the readme but let me know this still doesn't work.