[ARVADOS] updated: 1.1.2-267-g1e00053

Git user git at public.curoverse.com
Wed Feb 7 11:44:32 EST 2018


Summary of changes:
 sdk/R/R/Arvados.R          |  57 ++++++++--
 sdk/R/R/ArvadosFile.R      |  51 ++++++++-
 sdk/R/R/Collection.R       |  44 +++++++-
 sdk/R/R/Subcollection.R    |  41 +++++++-
 sdk/R/README               | 251 ---------------------------------------------
 sdk/R/README.Rmd           | 209 +++++++++++++++++++++++++++++++++++++
 sdk/R/man/Arvados.Rd       |  61 ++++++++---
 sdk/R/man/ArvadosFile.Rd   |  59 +++++++++--
 sdk/R/man/Collection.Rd    |  50 +++++++--
 sdk/R/man/Subcollection.Rd |  49 +++++++--
 10 files changed, 567 insertions(+), 305 deletions(-)
 delete mode 100644 sdk/R/README
 create mode 100644 sdk/R/README.Rmd

       via  1e00053e7bc962a827ae960c1953ac9bd63d503b (commit)
       via  4c7c4c13f51f99de535905ad02fe9239490a7956 (commit)
       via  8fb1de64d0caddc9fc533a964470de799b6044ff (commit)
      from  067ca04652413e2bacd76e9ac5c5c245aa27a291 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 1e00053e7bc962a827ae960c1953ac9bd63d503b
Author: Fuad Muhic <fmuhic at capeannenterprises.com>
Date:   Wed Feb 7 17:42:56 2018 +0100

    Added documentation to each public class of SDK.
    
    Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic at capeannenterprises.com>

diff --git a/sdk/R/R/Arvados.R b/sdk/R/R/Arvados.R
index ea4384b..d9bd091 100644
--- a/sdk/R/R/Arvados.R
+++ b/sdk/R/R/Arvados.R
@@ -2,14 +2,59 @@ source("./R/RESTService.R")
 source("./R/HttpRequest.R")
 source("./R/HttpParser.R")
 
-#' Arvados SDK Object
+#' Arvados
+#' 
+#' Arvados class gives users ability to manipulate collections and projects.
+#' 
+#' @section Usage:
+#' \preformatted{arv = Arvados$new(authToken, hostName, numRetries = 0)}
 #'
-#' All Arvados logic is inside this class
+#' @section Arguments:
+#' \describe{
+#'   \item{authToken}{Authentification token. If not specified ARVADOS_API_TOKEN environment variable will be used.}
+#'   \item{hostName}{Host name. If not specified ARVADOS_API_HOST environment variable will be used.}
+#'   \item{numRetries}{Number which specifies how many times to retry failed service requests.}
+#' }
+#' 
+#' @section Methods:
+#' \describe{
+#'   \item{getToken()}{Returns authentification token currently in use.}
+#'   \item{getHostName()}{Returns host name currently in use.}
+#'   \item{getNumRetries()}{Returns number which specifies how many times to retry failed service requests.}
+#'   \item{setNumRetries(newNumOfRetries)}{Sets number which specifies how many times to retry failed service requests.}
+#'   \item{getCollection(uuid)}{Get collection with specified UUID.}
+#'   \item{listCollections(filters = NULL, limit = 100, offset = 0)}{Returns list of collections based on filters parameter.}
+#'   \item{listAllCollections(filters = NULL)}{Lists all collections, based on filters parameter, even if the number of items is greater than maximum API limit.}
+#'   \item{deleteCollection(uuid)}{Deletes collection with specified UUID.}
+#'   \item{updateCollection(uuid, newContent)}{Updates collection with specified UUID.}
+#'   \item{createCollection(content)}{Creates new collection.}
+#'   \item{getProject(uuid)}{Get project with specified UUID.}
+#'   \item{listProjects(filters = NULL, limit = 100, offset = 0)}{Returns list of projects based on filters parameter.}
+#'   \item{listAllProjects(filters = NULL)}{Lists all projects, based on filters parameter, even if the number of items is greater than maximum API limit.}
+#'   \item{deleteProject(uuid)}{Deletes project with specified UUID.}
+#'   \item{updateProject(uuid, newContent)}{Updates project with specified UUID.}
+#'   \item{createProject(content)}{Creates new project.}
+#' }
 #'
-#' @field token Token represents user authentification token.
-#' @field host Host represents server name we wish to connect to.
-#' @examples arv = Arvados$new("token", "host_name")
-#' @export Arvados
+#' @name Arvados
+#' @examples
+#' \dontrun{
+#' arv <- Arvados$new("your Arvados token", "example.arvadosapi.com")
+#'
+#' collection <- arv$getCollection("uuid")
+#'
+#' collectionList <- arv$listCollections(list(list("name", "like", "Test%")))
+#' collectionList <- arv$listAllCollections(list(list("name", "like", "Test%")))
+#'
+#' deletedCollection <- arv$deleteCollection("uuid")
+#'
+#' updatedCollection <- arv$updateCollection("uuid", list(name = "New name", description = "New description"))
+#'
+#' createdCollection <- arv$createCollection(list(name = "Example", description = "This is a test collection"))
+#' }
+NULL
+
+#' @export
 Arvados <- R6::R6Class(
 
     "Arvados",
diff --git a/sdk/R/R/ArvadosFile.R b/sdk/R/R/ArvadosFile.R
index 3437933..53321ef 100644
--- a/sdk/R/R/ArvadosFile.R
+++ b/sdk/R/R/ArvadosFile.R
@@ -1,10 +1,55 @@
 source("./R/util.R")
 
-#' ArvadosFile Object
+#' ArvadosFile
+#' 
+#' ArvadosFile class represents a file inside Arvados collection.
+#' 
+#' @section Usage:
+#' \preformatted{file = ArvadosFile$new(name)}
 #'
-#' Update description
+#' @section Arguments:
+#' \describe{
+#'   \item{name}{Name of the file.}
+#' }
+#' 
+#' @section Methods:
+#' \describe{
+#'   \item{getName()}{Returns name of the file}
+#'   \item{getRelativePath()}{Returns file path relative to the root.}
+#'   \item{read(contentType = "raw", offset = 0, length = 0)}{Read file content.}
+#'   \item{write(content, contentType = "text/html")}{Write to file (override current content of the file).}
+#'   \item{connection(rw)}{Get connection opened in "read" or "write" mode.}
+#'   \item{flush()}{Write content of the connecitons buffer to a file (override current content of the file).}
+#'   \item{remove(name)}{Removes ArvadosFile or Subcollection specified by name from the subcollection.}
+#'   \item{getSizeInBytes()}{Returns file size in bytes.}
+#'   \item{move(newLocation)}{Moves file to a new location inside collection.}
+#' }
 #'
-#' @export ArvadosFile
+#' @name ArvadosFile
+#' @examples
+#' \dontrun{
+#' myFile <- ArvadosFile$new("myFile")
+#'
+#' myFile$write("This is new file content")
+#' fileContent <- myFile$read()
+#' fileContent <- myFile$read("text")
+#' fileContent <- myFile$read("raw", offset = 1024, length = 512)
+#'
+#'
+#' #Write a table:
+#' arvConnection <- myFile$connection("w")
+#' write.table(mytable, arvConnection)
+#' arvadosFile$flush()
+#'
+#' #Read a table:
+#' arvConnection <- myFile$connection("r")
+#' mytable <- read.table(arvConnection)
+#'
+#' myFile$move("newFolder/myFile")
+#' }
+NULL
+
+#' @export
 ArvadosFile <- R6::R6Class(
 
     "ArvadosFile",
diff --git a/sdk/R/R/Collection.R b/sdk/R/R/Collection.R
index 47d88ac..b788f9c 100644
--- a/sdk/R/R/Collection.R
+++ b/sdk/R/R/Collection.R
@@ -3,12 +3,48 @@ source("./R/ArvadosFile.R")
 source("./R/RESTService.R")
 source("./R/util.R")
 
-#' Arvados Collection Object
+#' Collection
+#' 
+#' Collection class provides interface for working with Arvados collections.
+#' 
+#' @section Usage:
+#' \preformatted{collection = Collection$new(arv, uuid)}
 #'
-#' Update description
+#' @section Arguments:
+#' \describe{
+#'   \item{arv}{Arvados object.}
+#'   \item{uuid}{UUID of a collection.}
+#' }
+#' 
+#' @section Methods:
+#' \describe{
+#'   \item{add(content)}{Adds ArvadosFile or Subcollection specified by content to the collection.}
+#'   \item{create(fileNames, relativePath = "")}{Creates one or more ArvadosFiles and adds them to the collection at specified path.}
+#'   \item{remove(fileNames)}{Remove one or more files from the collection.}
+#'   \item{move(content, newLocation)}{Moves ArvadosFile or Subcollection to another location in the collection.}
+#'   \item{getFileListing()}{Returns collections file content as character vector.}
+#'   \item{get(relativePath)}{If relativePath is valid, returns ArvadosFile or Subcollection specified by relativePath, else returns NULL.}
+#' }
 #'
-#' @examples arv = Collection$new(api, uuid)
-#' @export Collection
+#' @name Collection
+#' @examples
+#' \dontrun{
+#' collection <- Collection$new(arv, "uuid")
+#'
+#' collection$add(existingArvadosFile, "cpp")
+#'
+#' createdFiles <- collection$create(c("main.cpp", lib.dll), "cpp/src/")
+#'
+#' collection$remove("location/to/my/file.cpp")
+#'
+#' collection$move("folder/file.cpp", "file.cpp")
+#'
+#' arvadosFile <- collection$get("location/to/my/file.cpp")
+#' arvadosSubcollection <- collection$get("location/to/my/directory/")
+#' }
+NULL
+
+#' @export
 Collection <- R6::R6Class(
 
     "Collection",
diff --git a/sdk/R/R/Subcollection.R b/sdk/R/R/Subcollection.R
index d580695..179bbcd 100644
--- a/sdk/R/R/Subcollection.R
+++ b/sdk/R/R/Subcollection.R
@@ -1,10 +1,45 @@
 source("./R/util.R")
 
-#' Arvados SubCollection Object
+#' Subcollection
+#' 
+#' Subcollection class represents a folder inside Arvados collection.
+#' It is essentially a composite of ArvadosFiles and other Subcollections.
+#' 
+#' @section Usage:
+#' \preformatted{subcollection = Subcollection$new(name)}
 #'
-#' Update description
+#' @section Arguments:
+#' \describe{
+#'   \item{name}{Name of the subcollection.}
+#' }
+#' 
+#' @section Methods:
+#' \describe{
+#'   \item{getName()}{Returns name of the subcollection.}
+#'   \item{getRelativePath()}{Returns subcollection path relative to the root.}
+#'   \item{add(content)}{Adds ArvadosFile or Subcollection specified by content to the subcollection.}
+#'   \item{remove(name)}{Removes ArvadosFile or Subcollection specified by name from the subcollection.}
+#'   \item{get(relativePath)}{If relativePath is valid, returns ArvadosFile or Subcollection specified by relativePath, else returns NULL.}
+#'   \item{getFileListing()}{Returns subcollections file content as character vector.}
+#'   \item{getSizeInBytes()}{Returns subcollections content size in bytes.}
+#'   \item{move(newLocation)}{Moves subcollection to a new location inside collection.}
+#' }
 #'
-#' @export Subcollection
+#' @name Subcollection
+#' @examples
+#' \dontrun{
+#' myFolder <- Subcollection$new("myFolder")
+#' myFile   <- ArvadosFile$new("myFile")
+#'
+#' myFolder$add(myFile)
+#' myFolder$get("myFile")
+#' myFolder$remove("myFile")
+#'
+#' myFolder$move("newLocation/myFolder")
+#' }
+NULL
+
+#' @export
 Subcollection <- R6::R6Class(
 
     "Subcollection",
diff --git a/sdk/R/README.Rmd b/sdk/R/README.Rmd
index ebf591c..6315ddd 100644
--- a/sdk/R/README.Rmd
+++ b/sdk/R/README.Rmd
@@ -51,7 +51,7 @@ The API is not final and feedback is solicited from users on ways in which it co
     `collectionList$items_available # count of total number of items (may be more than returned due to paging)`  
     `collectionList$items # items which match the filter criteria`  
     
-* List all collections even when the number of items is greater than maximum API limit:
+* List all collections even if the number of items is greater than maximum API limit:
     
     `collectionList <- arv$listAllCollections(list(list("name", "like", "Test%")))`  
     
@@ -98,6 +98,11 @@ The API is not final and feedback is solicited from users on ways in which it co
     `arvConnection <- arvadosFile$connection("w")`  
     `write.table(mytable, arvConnection)`  
     `arvadosFile$flush()`  
+
+* Write to existing file (override current content of the file):
+    
+    `arvadosFile <- collection$get("location/to/my/file.cpp")`  
+    `arvadosFile$write("This is new file content")`  
     
 * Read whole file or just a portion of it:
     
@@ -133,11 +138,6 @@ The API is not final and feedback is solicited from users on ways in which it co
     This examples will add file "main.cpp" in "./cpp/src/" folder if folder exists.  
     If subcollection contains more files or folders they will be added recursively.  
     
-* Write to existing file (override current content of the file):
-    
-    `arvadosFile <- collection$get("location/to/my/file.cpp")`  
-    `arvadosFile$write("This is new file content")`  
-    
 * Delete file from a collection:
     
     `collection$remove("location/to/my/file.cpp")`  
@@ -185,7 +185,7 @@ The API is not final and feedback is solicited from users on ways in which it co
     `projects <- arv$listProjects(list(list("owner_uuid", "=", "aaaaa-j7d0g-ccccccccccccccc"))) # list subprojects of a project`  
     `arv$listProjects(list(list("name","like","Example%"))) # list projects which have names beginning with Example`  
     
-* List all projects even when the number of items is greater than maximum API limit:
+* List all projects even if the number of items is greater than maximum API limit:
     
     `collectionList <- arv$listAllProjects(list(list("name","like","Example%")))`  
     
diff --git a/sdk/R/man/Arvados.Rd b/sdk/R/man/Arvados.Rd
index 6dfb0ce..9173830 100644
--- a/sdk/R/man/Arvados.Rd
+++ b/sdk/R/man/Arvados.Rd
@@ -1,25 +1,60 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/Arvados.R
-\docType{data}
 \name{Arvados}
 \alias{Arvados}
-\title{Arvados SDK Object}
-\format{An object of class \code{R6ClassGenerator} of length 24.}
-\usage{
-Arvados
-}
+\title{Arvados}
 \description{
-All Arvados logic is inside this class
+Arvados class gives users ability to manipulate collections and projects.
+}
+\section{Usage}{
+
+\preformatted{arv = Arvados$new(authToken, hostName, numRetries = 0)}
 }
-\section{Fields}{
+
+\section{Arguments}{
 
 \describe{
-\item{\code{token}}{Token represents user authentification token.}
+  \item{authToken}{Authentification token. If not specified ARVADOS_API_TOKEN environment variable will be used.}
+  \item{hostName}{Host name. If not specified ARVADOS_API_HOST environment variable will be used.}
+  \item{numRetries}{Number which specifies how many times to retry failed service requests.}
+}
+}
 
-\item{\code{host}}{Host represents server name we wish to connect to.}
-}}
+\section{Methods}{
+
+\describe{
+  \item{getToken()}{Returns authentification token currently in use.}
+  \item{getHostName()}{Returns host name currently in use.}
+  \item{getNumRetries()}{Returns number which specifies how many times to retry failed service requests.}
+  \item{setNumRetries(newNumOfRetries)}{Sets number which specifies how many times to retry failed service requests.}
+  \item{getCollection(uuid)}{Get collection with specified UUID.}
+  \item{listCollections(filters = NULL, limit = 100, offset = 0)}{Returns list of collections based on filters parameter.}
+  \item{listAllCollections(filters = NULL)}{Lists all collections, based on filters parameter, even if the number of items is greater than maximum API limit.}
+  \item{deleteCollection(uuid)}{Deletes collection with specified UUID.}
+  \item{updateCollection(uuid, newContent)}{Updates collection with specified UUID.}
+  \item{createCollection(content)}{Creates new collection.}
+  \item{getProject(uuid)}{Get project with specified UUID.}
+  \item{listProjects(filters = NULL, limit = 100, offset = 0)}{Returns list of projects based on filters parameter.}
+  \item{listAllProjects(filters = NULL)}{Lists all projects, based on filters parameter, even if the number of items is greater than maximum API limit.}
+  \item{deleteProject(uuid)}{Deletes project with specified UUID.}
+  \item{updateProject(uuid, newContent)}{Updates project with specified UUID.}
+  \item{createProject(content)}{Creates new project.}
+}
+}
 
 \examples{
-arv = Arvados$new("token", "host_name")
+\dontrun{
+arv <- Arvados$new("your Arvados token", "example.arvadosapi.com")
+
+collection <- arv$getCollection("uuid")
+
+collectionList <- arv$listCollections(list(list("name", "like", "Test\%")))
+collectionList <- arv$listAllCollections(list(list("name", "like", "Test\%")))
+
+deletedCollection <- arv$deleteCollection("uuid")
+
+updatedCollection <- arv$updateCollection("uuid", list(name = "New name", description = "New description"))
+
+createdCollection <- arv$createCollection(list(name = "Example", description = "This is a test collection"))
+}
 }
-\keyword{datasets}
diff --git a/sdk/R/man/ArvadosFile.Rd b/sdk/R/man/ArvadosFile.Rd
index f48a71f..41f68bc 100644
--- a/sdk/R/man/ArvadosFile.Rd
+++ b/sdk/R/man/ArvadosFile.Rd
@@ -1,14 +1,57 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/ArvadosFile.R
-\docType{data}
 \name{ArvadosFile}
 \alias{ArvadosFile}
-\title{ArvadosFile Object}
-\format{An object of class \code{R6ClassGenerator} of length 24.}
-\usage{
-ArvadosFile
-}
+\title{ArvadosFile}
 \description{
-Update description
+ArvadosFile class represents a file inside Arvados collection.
+}
+\section{Usage}{
+
+\preformatted{file = ArvadosFile$new(name)}
+}
+
+\section{Arguments}{
+
+\describe{
+  \item{name}{Name of the file.}
+}
+}
+
+\section{Methods}{
+
+\describe{
+  \item{getName()}{Returns name of the file}
+  \item{getRelativePath()}{Returns file path relative to the root.}
+  \item{read(contentType = "raw", offset = 0, length = 0)}{Read file content.}
+  \item{write(content, contentType = "text/html")}{Write to file (override current content of the file).}
+  \item{connection(rw)}{Get connection opened in "read" or "write" mode.}
+  \item{flush()}{Write content of the connecitons buffer to a file (override current content of the file).}
+  \item{remove(name)}{Removes ArvadosFile or Subcollection specified by name from the subcollection.}
+  \item{getSizeInBytes()}{Returns file size in bytes.}
+  \item{move(newLocation)}{Moves file to a new location inside collection.}
+}
+}
+
+\examples{
+\dontrun{
+myFile <- ArvadosFile$new("myFile")
+
+myFile$write("This is new file content")
+fileContent <- myFile$read()
+fileContent <- myFile$read("text")
+fileContent <- myFile$read("raw", offset = 1024, length = 512)
+
+
+#Write a table:
+arvConnection <- myFile$connection("w")
+write.table(mytable, arvConnection)
+arvadosFile$flush()
+
+#Read a table:
+arvConnection <- myFile$connection("r")
+mytable <- read.table(arvConnection)
+
+myFile$move("newFolder/myFile")
+}
 }
-\keyword{datasets}
diff --git a/sdk/R/man/Collection.Rd b/sdk/R/man/Collection.Rd
index 46c76cb..4e96b7c 100644
--- a/sdk/R/man/Collection.Rd
+++ b/sdk/R/man/Collection.Rd
@@ -1,17 +1,49 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/Collection.R
-\docType{data}
 \name{Collection}
 \alias{Collection}
-\title{Arvados Collection Object}
-\format{An object of class \code{R6ClassGenerator} of length 24.}
-\usage{
-Collection
-}
+\title{Collection}
 \description{
-Update description
+Collection class provides interface for working with Arvados collections.
+}
+\section{Usage}{
+
+\preformatted{collection = Collection$new(arv, uuid)}
+}
+
+\section{Arguments}{
+
+\describe{
+  \item{arv}{Arvados object.}
+  \item{uuid}{UUID of a collection.}
+}
 }
+
+\section{Methods}{
+
+\describe{
+  \item{add(content)}{Adds ArvadosFile or Subcollection specified by content to the collection.}
+  \item{create(fileNames, relativePath = "")}{Creates one or more ArvadosFiles and adds them to the collection at specified path.}
+  \item{remove(fileNames)}{Remove one or more files from the collection.}
+  \item{move(content, newLocation)}{Moves ArvadosFile or Subcollection to another location in the collection.}
+  \item{getFileListing()}{Returns collections file content as character vector.}
+  \item{get(relativePath)}{If relativePath is valid, returns ArvadosFile or Subcollection specified by relativePath, else returns NULL.}
+}
+}
+
 \examples{
-arv = Collection$new(api, uuid)
+\dontrun{
+collection <- Collection$new(arv, "uuid")
+
+collection$add(existingArvadosFile, "cpp")
+
+createdFiles <- collection$create(c("main.cpp", lib.dll), "cpp/src/")
+
+collection$remove("location/to/my/file.cpp")
+
+collection$move("folder/file.cpp", "file.cpp")
+
+arvadosFile <- collection$get("location/to/my/file.cpp")
+arvadosSubcollection <- collection$get("location/to/my/directory/")
+}
 }
-\keyword{datasets}
diff --git a/sdk/R/man/Subcollection.Rd b/sdk/R/man/Subcollection.Rd
index e644e02..df0970b 100644
--- a/sdk/R/man/Subcollection.Rd
+++ b/sdk/R/man/Subcollection.Rd
@@ -1,14 +1,47 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/Subcollection.R
-\docType{data}
 \name{Subcollection}
 \alias{Subcollection}
-\title{Arvados SubCollection Object}
-\format{An object of class \code{R6ClassGenerator} of length 24.}
-\usage{
-Subcollection
-}
+\title{Subcollection}
 \description{
-Update description
+Subcollection class represents a folder inside Arvados collection.
+It is essentially a composite of ArvadosFiles and other Subcollections.
+}
+\section{Usage}{
+
+\preformatted{subcollection = Subcollection$new(name)}
+}
+
+\section{Arguments}{
+
+\describe{
+  \item{name}{Name of the subcollection.}
+}
+}
+
+\section{Methods}{
+
+\describe{
+  \item{getName()}{Returns name of the subcollection.}
+  \item{getRelativePath()}{Returns subcollection path relative to the root.}
+  \item{add(content)}{Adds ArvadosFile or Subcollection specified by content to the subcollection.}
+  \item{remove(name)}{Removes ArvadosFile or Subcollection specified by name from the subcollection.}
+  \item{get(relativePath)}{If relativePath is valid, returns ArvadosFile or Subcollection specified by relativePath, else returns NULL.}
+  \item{getFileListing()}{Returns subcollections file content as character vector.}
+  \item{getSizeInBytes()}{Returns subcollections content size in bytes.}
+  \item{move(newLocation)}{Moves subcollection to a new location inside collection.}
+}
+}
+
+\examples{
+\dontrun{
+myFolder <- Subcollection$new("myFolder")
+myFile   <- ArvadosFile$new("myFile")
+
+myFolder$add(myFile)
+myFolder$get("myFile")
+myFolder$remove("myFile")
+
+myFolder$move("newLocation/myFolder")
+}
 }
-\keyword{datasets}

commit 4c7c4c13f51f99de535905ad02fe9239490a7956
Author: Fuad Muhic <fmuhic at capeannenterprises.com>
Date:   Wed Feb 7 12:19:25 2018 +0100

    Replaced README with README.Rmd
    
    Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic at capeannenterprises.com>

diff --git a/sdk/R/README b/sdk/R/README
deleted file mode 100644
index 4c99c75..0000000
--- a/sdk/R/README
+++ /dev/null
@@ -1,251 +0,0 @@
-R SDK for Arvados
-
-This SDK focuses on providing support for accessing Arvados projects, collections, and the files within collections.
-
-The API is not final and feedback is solicited from users on ways in which it could be improved.
-
-INSTALLATION
-
-1. Install the dependencies
-
-    > install.packages(c('R6', 'httr', 'stringr', 'jsonlite', 'curl', 'XML'))
-
-If needed, you may have to install the supporting packages first. On Linux, these are:
-
-    libxml2-dev, libssl-dev, libcurl4-gnutls-dev or libcurl4-openssl-dev
-
-2. Install the ArvardosR package
-
-    > install.packages('/path/to/ArvadosR_0.0.2.tar.gz', repos = NULL, type="source", dependencies = TRUE)
-
-
-EXAMPLES OF USAGE
-
-
-#Load Library and Initialize API:
-
-library('ArvadosR')
-arv <- Arvados$new() # uses environment variables ARVADOS_API_TOKEN and ARVADOS_API_HOST
-arv <- Arvados$new("your Arvados token", "example.arvadosapi.com")
-
-
-#Optionally, add numRetries parameter to specify number of times to retry failed service requests.
-#Default is 0.
-
-arv <- Arvados$new("your Arvados token", "example.arvadosapi.com", numRetries = 3)
-
-#This parameter can be set at any time using setNumRetries 
-
-arv$setNumRetries(5)
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Get a collection:
-
-arv$getCollection("uuid")
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#List collections:
-collectionList <- arv$listCollections(list(list("name", "like", "Test%"))) # offset of 0 and default limit of 100
-collectionList <- arv$listCollections(list(list("name", "like", "Test%")), limit = 10, offset = 2)
-
-collectionList$items_available # count of total number of items (may be more than returned due to paging)
-collectionList$items # items which match the filter criteria
-
-#Next example will list all collections even when the number of items is greater than maximum API limit
-
-collectionList <- arv$listAllCollections(list(list("name", "like", "Test%")))
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Delete a collection:
-
-deletedCollection <- arv$deleteCollection("uuid")
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Update a collection's metadata:
-
-updatedCollection <- arv$updateCollection("uuid", list(name = "New name", description = "New description"))
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Create collection:
-
-createdCollection <- arv$createCollection(list(name = "Example", description = "This is a test collection"))
-
-
---------------------------------------------------------------------------------------------------------------------------------
-COLLECTION CONTENT MANIPULATION
---------------------------------------------------------------------------------------------------------------------------------
-
-#Create collection object:
-
-collection <- Collection$new(arv, "uuid")
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Get list of files
-
-collection$getFileListing()
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#This will return ArvadosFile or Subcollection from internal tree-like structure.
-
-arvadosFile <- collection$get("location/to/my/file.cpp")
-
-#or
-
-arvadosSubcollection <- collection$get("location/to/my/directory/")
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Read a table
-
-arvadosFile   <- collection$get("myinput.txt")
-arvConnection <- arvadosFile$connection("r")
-mytable       <- read.table(arvConnection)
-
-#Write a table
-
-arvadosFile   <- collection$create("myoutput.txt")
-arvConnection <- arvadosFile$connection("w")
-write.table(mytable, arvConnection)
-arvadosFile$flush()
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Read whole file or just a portion of it.
-
-fileContent <- arvadosFile$read()
-fileContent <- arvadosFile$read("text")
-fileContent <- arvadosFile$read("raw", offset = 1024, length = 512)
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Get ArvadosFile or Subcollection size
-
-size <- arvadosFile$getSizeInBytes()
-size <- arvadosSubcollection$getSizeInBytes()
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Create new file in a collection
-
-collection$create(fileNames, optionalRelativePath)
-
-#Example
-
-mainFile <- collection$create("main.cpp", "cpp/src/")
-fileList <- collection$create(c("main.cpp", lib.dll), "cpp/src/")
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Add existing ArvadosFile or Subcollection to a collection
-
-folder <- Subcollection$new("src")
-file   <- ArvadosFile$new("main.cpp")
-folder$add(file)
-
-collection$add(folder, "cpp")
-
-#This examples will add file "main.cpp" in "./cpp/src/" folder if folder exists.
-#If subcollection contains more files or folders they will be added recursively.
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Write to existing file (Override current content of the file)
-
-arvadosFile <- collection$get("location/to/my/file.cpp")
-
-arvadosFile$write("This is new file content")
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Delete file from a collection
-
-collection$remove("location/to/my/file.cpp")
-
-#You can remove both Subcollection and ArvadosFile
-#If subcollection contains more files or folders they will be removed recursively.
-
-#You can also remove multiple files
-
-collection$remove(c("path/to/my/file.cpp", "path/to/other/file.cpp"))
-
-#Delete file or folder from a Subcollection
-
-subcollection <- collection$get("mySubcollection/")
-subcollection$remove("fileInsideSubcollection.exe")
-subcollection$remove("folderInsideSubcollection/")
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Move file or folder inside collection
-
-#Directley from collection
-
-collection$move("folder/file.cpp", "file.cpp")
-
-#Or from file
-
-file <- collection$get("location/to/my/file.cpp")
-file$move("newDestination/file.cpp")
-
-#Or from subcollection
-
-subcollection <- collection$get("location/to/folder")
-subcollection$move("newDestination/folder")
-
-#Make sure to include new file name in destination
-#In second example file$move("newDestination/") will not work
-
---------------------------------------------------------------------------------------------------------------------------------
-WORKING WITH ARVADOS PROJECTS
---------------------------------------------------------------------------------------------------------------------------------
-
-#Get a project:
-
-arv$getProject("uuid")
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#List projects:
-
-projects <- arv$listProjects(list(list("owner_uuid", "=", "aaaaa-j7d0g-ccccccccccccccc"))) # list subprojects of a project
-arv$listProjects(list(list("name","like","Example%"))) # list projects which have names beginning with Example
-
-#Next example will list all projects even when the number of items is greater than maximum API limit
-
-collectionList <- arv$listAllProjects(list(list("name","like","Example%")))
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Delete a project:
-
-deletedProject <- arv$deleteProject("uuid")
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Update project:
-
-updatedProject <- arv$updateProject("uuid", list(name = "new_name", description = "new description"))
-
---------------------------------------------------------------------------------------------------------------------------------
-
-#Create project:
-
-createdProject <- arv$createProject(list(name = "project_name", description = "project description"))
-
-
---------------------------------------------------------------------------------------------------------------------------------
-BUILDING THE ARVADOS SDK TARBALL
---------------------------------------------------------------------------------------------------------------------------------
-
-
-cd arvados/sdk
-R CMD build R
-
-This will create a tarball of the Arvados package in the current directory.
diff --git a/sdk/R/README.Rmd b/sdk/R/README.Rmd
new file mode 100644
index 0000000..ebf591c
--- /dev/null
+++ b/sdk/R/README.Rmd
@@ -0,0 +1,209 @@
+## R SDK for Arvados
+
+This SDK focuses on providing support for accessing Arvados projects, collections, and the files within collections.
+The API is not final and feedback is solicited from users on ways in which it could be improved.
+
+### INSTALLATION
+
+1. Install the dependencies
+
+    `install.packages(c('R6', 'httr', 'stringr', 'jsonlite', 'curl', 'XML'))`
+
+    If needed, you may have to install the supporting packages first.  
+    On Linux, these are: libxml2-dev, libssl-dev, libcurl4-gnutls-dev or libcurl4-openssl-dev
+    
+
+2. Install the ArvardosR package
+
+    `install.packages('/path/to/ArvadosR_0.0.2.tar.gz', repos = NULL, type="source", dependencies = TRUE)`
+    
+### EXAMPLES OF USAGE
+
+#### INITIALIZING API
+
+* Load Library and Initialize API:
+
+    `library('ArvadosR')`  
+    `arv <- Arvados$new() # uses environment variables ARVADOS_API_TOKEN and ARVADOS_API_HOST`    
+    `arv <- Arvados$new("your Arvados token", "example.arvadosapi.com")`  
+    
+    Optionally, add numRetries parameter to specify number of times to retry failed service requests.  
+    Default is 0.  
+    
+    `arv <- Arvados$new("your Arvados token", "example.arvadosapi.com", numRetries = 3)`  
+    
+    This parameter can be set at any time using setNumRetries  
+    
+    `arv$setNumRetries(5)`  
+      
+
+#### WORKING WITH COLLECTIONS
+
+* Get a collection:
+    
+    `collection <- arv$getCollection("uuid")`  
+    
+* List collections:
+
+    `collectionList <- arv$listCollections(list(list("name", "like", "Test%"))) # offset of 0 and default limit of 100`  
+    `collectionList <- arv$listCollections(list(list("name", "like", "Test%")), limit = 10, offset = 2)`  
+    
+    `collectionList$items_available # count of total number of items (may be more than returned due to paging)`  
+    `collectionList$items # items which match the filter criteria`  
+    
+* List all collections even when the number of items is greater than maximum API limit:
+    
+    `collectionList <- arv$listAllCollections(list(list("name", "like", "Test%")))`  
+    
+* Delete a collection:
+    
+    `deletedCollection <- arv$deleteCollection("uuid")`  
+    
+* Update a collection's metadata:
+    
+    `updatedCollection <- arv$updateCollection("uuid", list(name = "New name", description = "New description"))`  
+    
+* Create collection:
+    
+    `createdCollection <- arv$createCollection(list(name = "Example", description = "This is a test collection"))`
+      
+      
+#### MANIPULATIN COLLECTION CONTENT
+
+* Create collection object:
+    
+    `collection <- Collection$new(arv, "uuid")`  
+    
+* Get list of files:
+    
+    `files <- collection$getFileListing()`  
+    
+* Get ArvadosFile or Subcollection from internal tree-like structure:
+    
+    `arvadosFile <- collection$get("location/to/my/file.cpp")`  
+    
+    or  
+    
+    `arvadosSubcollection <- collection$get("location/to/my/directory/")`  
+    
+* Read a table:
+    
+    `arvadosFile   <- collection$get("myinput.txt")`  
+    `arvConnection <- arvadosFile$connection("r")`  
+    `mytable       <- read.table(arvConnection)`  
+    
+* Write a table:
+    
+    `arvadosFile   <- collection$create("myoutput.txt")`  
+    `arvConnection <- arvadosFile$connection("w")`  
+    `write.table(mytable, arvConnection)`  
+    `arvadosFile$flush()`  
+    
+* Read whole file or just a portion of it:
+    
+    `fileContent <- arvadosFile$read()`  
+    `fileContent <- arvadosFile$read("text")`  
+    `fileContent <- arvadosFile$read("raw", offset = 1024, length = 512)`  
+    
+* Get ArvadosFile or Subcollection size:
+    
+    `size <- arvadosFile$getSizeInBytes()`  
+    
+    or  
+    
+    `size <- arvadosSubcollection$getSizeInBytes()`
+    
+* Create new file in a collection:
+    
+    `collection$create(fileNames, optionalRelativePath)`  
+    
+    Example:
+    
+    `mainFile <- collection$create("main.cpp", "cpp/src/")`  
+    `fileList <- collection$create(c("main.cpp", lib.dll), "cpp/src/")`  
+    
+* Add existing ArvadosFile or Subcollection to a collection:
+    
+    `folder <- Subcollection$new("src")`  
+    `file   <- ArvadosFile$new("main.cpp")`  
+    `folder$add(file)`  
+    
+    `collection$add(folder, "cpp")`  
+    
+    This examples will add file "main.cpp" in "./cpp/src/" folder if folder exists.  
+    If subcollection contains more files or folders they will be added recursively.  
+    
+* Write to existing file (override current content of the file):
+    
+    `arvadosFile <- collection$get("location/to/my/file.cpp")`  
+    `arvadosFile$write("This is new file content")`  
+    
+* Delete file from a collection:
+    
+    `collection$remove("location/to/my/file.cpp")`  
+    
+    You can remove both Subcollection and ArvadosFile.  
+    If subcollection contains more files or folders they will be removed recursively.  
+    
+    You can also remove multiple files at once:  
+    
+    `collection$remove(c("path/to/my/file.cpp", "path/to/other/file.cpp"))`  
+    
+* Delete file or folder from a Subcollection:
+    
+    `subcollection <- collection$get("mySubcollection/")`  
+    `subcollection$remove("fileInsideSubcollection.exe")`  
+    `subcollection$remove("folderInsideSubcollection/")`  
+    
+* Move file or folder inside collection:
+    
+    Directley from collection  
+    
+    `collection$move("folder/file.cpp", "file.cpp")`  
+    
+    Or from file
+    
+    `file <- collection$get("location/to/my/file.cpp")`  
+    `file$move("newDestination/file.cpp")`  
+    
+    Or from subcollection
+    
+    `subcollection <- collection$get("location/to/folder")` 
+    `subcollection$move("newDestination/folder")` 
+    
+    Make sure to include new file name in destination.
+    In second example file$move("newDestination/") will not work.  
+
+#### WORKING WITH ARVADOS PROJECTS
+
+* Get a project:
+    
+    `project <- arv$getProject("uuid")`  
+    
+* List projects:
+    
+    `projects <- arv$listProjects(list(list("owner_uuid", "=", "aaaaa-j7d0g-ccccccccccccccc"))) # list subprojects of a project`  
+    `arv$listProjects(list(list("name","like","Example%"))) # list projects which have names beginning with Example`  
+    
+* List all projects even when the number of items is greater than maximum API limit:
+    
+    `collectionList <- arv$listAllProjects(list(list("name","like","Example%")))`  
+    
+* Delete a project:
+    
+    `deletedProject <- arv$deleteProject("uuid")`  
+    
+* Update project:
+    
+    `updatedProject <- arv$updateProject("uuid", list(name = "new_name", description = "new description"))`
+    
+* Create project:
+    
+    `createdProject <- arv$createProject(list(name = "project_name", description = "project description"))`  
+    
+### BUILDING THE ARVADOS SDK TARBALL
+
+cd arvados/sdk
+R CMD build R
+
+This will create a tarball of the Arvados package in the current directory.

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list