Merge branch 'master' of git.curoverse.com:arvados into 11876-r-sdk
[arvados.git] / sdk / R / README
1 R SDK for Arvados
2
3 Examples of usage:
4
5 --------------------------------------------------------------------------------------------------------------------------------
6
7 #Initialize API:
8
9 arv <- Arvados$new("insert_token", "insert_host_name")
10
11 --------------------------------------------------------------------------------------------------------------------------------
12
13 #Get collection:
14
15 arv$getCollection("uuid")
16
17 --------------------------------------------------------------------------------------------------------------------------------
18
19 #List collections:
20
21 collectionList <- arv$listCollections(list("uuid", "=" "aaaaa-bbbbb-ccccccccccccccc"), limit = 10, offset = 2)
22
23 --------------------------------------------------------------------------------------------------------------------------------
24
25 #Delete collection:
26
27 deletedCollection <- arv$deleteCollection("uuid")
28
29 --------------------------------------------------------------------------------------------------------------------------------
30
31 #Update collection:
32
33 updatedCollection <- arv$updateCollection("uuid", list(collection = list(name = "new_name", description = "new_desciption")))
34
35 --------------------------------------------------------------------------------------------------------------------------------
36
37 #Create collection:
38
39 updatedCollection <- arv$createCollection("uuid", list(collection = list(name = "new_name", description = "new_desciption")))
40
41 --------------------------------------------------------------------------------------------------------------------------------
42
43 --------------------------------------------------------------------------------------------------------------------------------
44
45 #Collection manipulation:
46
47 --------------------------------------------------------------------------------------------------------------------------------
48
49 --------------------------------------------------------------------------------------------------------------------------------
50
51 #Create collection object:
52
53 arv <- Arvados$new("insert_token", "insert_host_name")
54 collection <- Collection$new(arv, "uuid")
55
56 --------------------------------------------------------------------------------------------------------------------------------
57
58 #Print content of the collection
59
60 collection$printFileContent()
61
62 #of if you just want a list of relative paths:
63
64 collection$printFileContent(pretty = FALSE)
65
66 --------------------------------------------------------------------------------------------------------------------------------
67
68 #This will return ArvadosFile or Subcollection from internal tree-like structure.
69
70 arvadosFile <- collection$get("location/to/my/file.cpp")
71
72 #or
73
74 arvadosSubcollection <- collection.get("location/to/my/directory/")
75
76 --------------------------------------------------------------------------------------------------------------------------------
77
78 #Read whole file or just a portion of it.
79
80 arvadosFile$read(offset = 1024, length = 512)
81
82 --------------------------------------------------------------------------------------------------------------------------------