diff --git a/DESCRIPTION b/DESCRIPTION index 5c7f3a7..4e643cb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: sbtools Title: USGS SB tools Maintainer: Luke Winslow -Version: 0.8.1 +Version: 0.8.2 Author: Luke Winslow Description: Tools for interacting with SB interfaces. Imports: diff --git a/R/authenticate_sb.R b/R/authenticate_sb.R index 86080d2..79e5c76 100644 --- a/R/authenticate_sb.R +++ b/R/authenticate_sb.R @@ -2,13 +2,16 @@ #' #'@title Authenticate to SB for subsequent calls #' +#'@param username Sciencebase username +#'@param password (optional) Sciencebase password, prompts user if not supplied #' +#'@description +#'This connects to SB, authenticates and gets a session token for +#'communicating with SB. #' +#'@import httr #' #' -#' -#' -#'@import httr #'@export authenticate_sb = function(username, password){ diff --git a/R/item_append_files.R b/R/item_append_files.R index 284cdcb..f072138 100644 --- a/R/item_append_files.R +++ b/R/item_append_files.R @@ -3,13 +3,14 @@ #' #'@param id A ScienceBase item ID to upload to. #'@param files A file path to upload. -#'@param sb_session A ScienceBase session object from authenticate_sb. +#'@param session A ScienceBase session object from authenticate_sb. #' #'@return ScienceBase Item. #' #'@import httr #' -#'@examples \dontrun{ +#'@examples +#'\dontrun{ #' sb_session<-authenticate_sb(sbusername) #' item_append_files("54e265a4e4b08de9379b4dfb", '/foo/bar/baz.zip', sb) #' } diff --git a/R/item_create.R b/R/item_create.R index 5a05b04..02a0144 100644 --- a/R/item_create.R +++ b/R/item_create.R @@ -2,11 +2,12 @@ #'@title Create a new SB item #' #'@param parent_id ID of the parent item +#'@param title The title of the new SB item #'@param session Authenticated session object (from \link{authenticate_sb}) #'@param info (optional) list of metadata info for the new item #'@return SB ID for the newly created item #' -#' +#'x #'@import httr #' #'@export diff --git a/R/item_file_download.R b/R/item_file_download.R index c1ec622..9d66faf 100644 --- a/R/item_file_download.R +++ b/R/item_file_download.R @@ -6,6 +6,7 @@ #'@param destinations String vector list of destinations for requested files. Must be same length as \code{names} #'@param dest_dir A directory path for saving files when \code{names} parameter is omitted #'@param session Session object from \code{\link{authenticate_sb}} +#'@param overwrite_file Boolean indicating if file should be overwritten if it already exists locally #' #'@description #'Function to downlod files attached to an item on SB. Either files can be specified directly diff --git a/R/item_list_files.R b/R/item_list_files.R index 2bff648..41dfbcb 100644 --- a/R/item_list_files.R +++ b/R/item_list_files.R @@ -1,7 +1,7 @@ #'@title Get list of files attached to SB item #' #'@param id item ID -#'@param Session Session object from \link{authenticate_sb} +#'@param session Session object from \link{authenticate_sb} #' #'@return #'A data.frame with columns fname, size, and url. diff --git a/R/item_rm.R b/R/item_rm.R index 5b3c3e8..bcdc78a 100644 --- a/R/item_rm.R +++ b/R/item_rm.R @@ -1,6 +1,6 @@ #'@title Remove item from SB #' -#'@param SB item ID +#'@param id item ID #'@param session Session object from \code{\link{authenticate_sb}} #' #'@return TRUE to indicate success diff --git a/R/items_query.R b/R/query_items.R similarity index 65% rename from R/items_query.R rename to R/query_items.R index 8eb02f0..265157f 100644 --- a/R/items_query.R +++ b/R/query_items.R @@ -3,8 +3,8 @@ #' #'@param query_list #' -#' -#' +#'@param query_list List of item query selectors +#'@param session Session object from \code{\link{authenticate_sb}} #' #' #'@export diff --git a/man/authenticate_sb.Rd b/man/authenticate_sb.Rd index 5c53bfb..e98e429 100644 --- a/man/authenticate_sb.Rd +++ b/man/authenticate_sb.Rd @@ -6,7 +6,16 @@ \usage{ authenticate_sb(username, password) } +\arguments{ +\item{username}{Sciencebase username} + +\item{password}{(optional) Sciencebase password, prompts user if not supplied} +} \description{ +This connects to SB, authenticates and gets a session token for +communicating with SB. +} +\details{ } diff --git a/man/item_append_files.Rd b/man/item_append_files.Rd index e00351b..66031e4 100644 --- a/man/item_append_files.Rd +++ b/man/item_append_files.Rd @@ -11,7 +11,7 @@ item_append_files(id, files, session) \item{files}{A file path to upload.} -\item{sb_session}{A ScienceBase session object from authenticate_sb.} +\item{session}{A ScienceBase session object from authenticate_sb.} } \value{ ScienceBase Item. diff --git a/man/item_create.Rd b/man/item_create.Rd index 3020463..548a455 100644 --- a/man/item_create.Rd +++ b/man/item_create.Rd @@ -9,12 +9,16 @@ item_create(parent_id, title, session, info) \arguments{ \item{parent_id}{ID of the parent item} +\item{title}{The title of the new SB item} + \item{session}{Authenticated session object (from \link{authenticate_sb})} \item{info}{(optional) list of metadata info for the new item} } \value{ SB ID for the newly created item + +x } \description{ Create a new SB item diff --git a/man/item_file_download.Rd b/man/item_file_download.Rd index c3cdf3b..ec513bd 100644 --- a/man/item_file_download.Rd +++ b/man/item_file_download.Rd @@ -17,6 +17,8 @@ item_file_download(id, names, destinations, dest_dir, session = NULL, \item{dest_dir}{A directory path for saving files when \code{names} parameter is omitted} \item{session}{Session object from \code{\link{authenticate_sb}}} + +\item{overwrite_file}{Boolean indicating if file should be overwritten if it already exists locally} } \description{ Function to downlod files attached to an item on SB. Either files can be specified directly diff --git a/man/item_list_files.Rd b/man/item_list_files.Rd index 676f9da..202c68c 100644 --- a/man/item_list_files.Rd +++ b/man/item_list_files.Rd @@ -9,7 +9,7 @@ item_list_files(id, session = NULL) \arguments{ \item{id}{item ID} -\item{Session}{Session object from \link{authenticate_sb}} +\item{session}{Session object from \link{authenticate_sb}} } \value{ A data.frame with columns fname, size, and url. diff --git a/man/item_rm.Rd b/man/item_rm.Rd index 283c5ad..b849818 100644 --- a/man/item_rm.Rd +++ b/man/item_rm.Rd @@ -7,9 +7,9 @@ item_rm(id, session) } \arguments{ -\item{session}{Session object from \code{\link{authenticate_sb}}} +\item{id}{item ID} -\item{SB}{item ID} +\item{session}{Session object from \code{\link{authenticate_sb}}} } \value{ TRUE to indicate success diff --git a/man/query_items.Rd b/man/query_items.Rd index 30f7f23..fed4d90 100644 --- a/man/query_items.Rd +++ b/man/query_items.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2 (4.1.0): do not edit by hand -% Please edit documentation in R/items_query.R +% Please edit documentation in R/query_items.R \name{query_items} \alias{query_items} \title{Query SB for items using generic query parameters} @@ -8,6 +8,10 @@ query_items(query_list, session) } \arguments{ \item{query_list}{} + +\item{session}{Session object from \code{\link{authenticate_sb}}} + +\item{query_list}{List of item query selectors} } \description{