View source: R/item_list_files.R
item_list_files | R Documentation |
Lists all files attached to a SB item. Files can be downloaded
from ScienceBase using item_file_download
.
(advanced) Recursive options lists all files attached to an item and all children items.
NOTE: A sciencebase item can contain so-called "extensions". The sciencebase item data model refers to the information that describes an extension as a "facet". Some extension facets contain files (such as with a shapefile). The "facet" attribute of the return from this function will contain the name of the facet the file came from if the file was found in a facet.
item_list_files(sb_id, recursive = FALSE, fetch_cloud_urls = TRUE, ...)
sb_id |
An |
recursive |
(logical) List files recursively. Default: |
fetch_cloud_urls |
(logical) fetch a tokenized cloud download URLs? Default: |
... |
Additional parameters are passed on to |
A data.frame with columns fname, size, url, and facet. If item has no attached files, returns a zero row data.frame.
## Not run:
#regular files
item_list_files("57976a0ce4b021cadec97890")
# files in facets
item_list_files("5ebe92af82ce476925e44b8f")
# list files recursively
## create item
id <- item_create(user_id(), title="some title")
## 1. create nested item w/ file
file <- system.file("examples", "books.json", package = "sbtools")
id2 <- item_create(id, title = "newest-thing")
item_upload_create(id2, file)
## 2. create nested item w/ file
file <- system.file("examples", "species.json", package = "sbtools")
id3 <- item_create(id, title = "a-new-thing")
item_upload_create(id3, file)
## 3. create nested item w/ file
file <- system.file("examples", "data.csv", package = "sbtools")
id4 <- item_create(id, title = "another-thing")
item_upload_create(id4, file)
item_list_files(id = '56562348e4b071e7ea53e09d', recursive = FALSE) # default
item_list_files(id = '56562348e4b071e7ea53e09d', recursive = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.