Documentation for Arvados classes is generated automatically now
[arvados.git] / sdk / R / R / util.R
index f6a582ff177b3b9aea4234486868142e19f10c59..d9af8b057bbb00b42611894fe2186aa6f87b0caf 100644 (file)
@@ -14,22 +14,23 @@ trimFromEnd <- function(sample, trimCharacters)
     sample
 }
 
-RListToPythonList <- function(sample, separator = ", ")
+RListToPythonList <- function(RList, separator = ", ")
 {
-    pythonArrayContent <- sapply(sample, function(sampleUnit)
+    pythonArrayContent <- sapply(RList, function(elementInList)
     {
-        if((is.vector(sampleUnit) || is.list(sampleUnit)) &&
-            length(sampleUnit) > 1)
+        if((is.vector(elementInList) || is.list(elementInList)) &&
+            length(elementInList) > 1)
         {
-            return(RListToPythonList(sampleUnit, separator))
+            return(RListToPythonList(elementInList, separator))
         }
         else
         {
-            return(paste0("\"", sampleUnit, "\""))
+            return(paste0("\"", elementInList, "\""))
         }
     })
 
-    return(paste0("[", paste0(pythonArrayContent, collapse = separator), "]"))
+    pythonArray <- paste0("[", paste0(pythonArrayContent, collapse = separator), "]")
+    pythonArray
 }
 
 appendToStartIfNotExist <- function(sample, characters)
@@ -48,6 +49,6 @@ splitToPathAndName = function(path)
     nameAndPath$name <- components[length(components)]
     nameAndPath$path <- trimFromStart(paste0(components[-length(components)], collapse = "/"),
                                       "/")
-    
+
     nameAndPath
 }