locate_item: Find a folder or other item on ScienceBase

View source: R/locate_item.R

locate_itemR Documentation

Find a folder or other item on ScienceBase

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

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

## 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 June 3, 2023, 8:43 a.m.