locate_item: Find a folder or other item on ScienceBase

Description Usage Arguments Examples

View source: R/locate_item.R

Description

locate_item is case insensitive. This function is only guaranteed to return the first match; others may exist and may or may not be returned.

Usage

1
2
3
locate_item(key, type, format = c("id", "item_url", "folder_url"),
  by = c("tag", "dir", "either"), parent, title, limit = 5000,
  browser = (format %in% c("item_url", "folder_url")))

Arguments

key

the item key, probably identical to the folder name. Examples are c("nwis_02322688", "project", "presentations", "proposals", "publications", "sites")

type

the item type, probably either root or site_root. Examples are c("site_root","root")

format

character indicating whether the folder should be returned as an ID or as a full URL

by

character indicating how to search for the item: using tags ("tag", the default and recommended option), by scanning the parent directory for the desired title ("dir"), or both in combination ("either")?

parent

the ScienceBase ID of the parent whose children to search if by %in% c("dir","either")

title

the title to seek among the children if by %in% c("dir","either")

limit

number of items to return, as in query_item_identifier or item_list_children

browser

logical. Should the URL be opened in a browser?

Examples

1
2
3
4
5
6
7
## Not run: 
mda.streams:::locate_item(key="sites", type="root")
mda.streams:::locate_item(key=c("sites","proposals","publications"), 
  type="root", format="folder_url")
mda.streams:::locate_item(key="nwis_02322688", type="site_root")

## End(Not run)

USGS-R/mda.streams documentation built on Dec. 19, 2017, 10:25 p.m.