Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to filter resource search results #36

Open
seladore opened this issue Dec 15, 2017 · 1 comment
Open

Add function to filter resource search results #36

seladore opened this issue Dec 15, 2017 · 1 comment
Labels

Comments

@seladore
Copy link
Contributor

seladore commented Dec 15, 2017

Is there a machine name to indicate whether the resource is actually the data. Might help to have a function that filters the resource results by download/query tool to make the actual data more obvious. Identifying the data file/query tool/link is not clear when there are several resources (ex: WDI is ~70).

example
current

indicators_resources = get_resource_nid(nid = wdi_nid)
# need to locate the tid for dataset resource_type
tid_download = 986

for (resource_id in indicators_resources){
  resource_metadata = get_metadata(nid = resource_id)
  if (resource_metadata$field_wbddh_resource_type$und$tid == tid_download){
    print(resource_metadata$title)
  }
}

library(rcurl)
resource_metadata = get_metadata(nid = 94974)
download.file(url = resource_metadata$field_link_api$und$url, destfile = "WDI")

suggested

indicators_resources = get_resource_nid(nid = wdi_nid)
get_data(resource_ids, access_type = c("download, "query tool"))
@seladore
Copy link
Contributor Author

Might want to consider providing an option to download excel/csv/etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant