i have a function which return two values.
definePosition <- function(nodeList){
#  nodeList = node_names
  # unique name endings
  endings = unique(sub('.*_', '', nodeList))
  # define intervals
  steps = 1/length(endings)
  # x-values for each unique name ending
  # for input as node position
  nodes_x = {}
  xVal = 0
  for (e in endings) {
    nodes_x[e] = xVal
    xVal = xVal + steps
  }
  # x and y values in list form
  x_values <- 0
  y_values <- 0
  i =0
  for (n in nodeList) {
   last = sub('.*_', '', n)
    x_values[i] = nodes_x[last]
    y_values[i] = 0.1 * length(x_values)
    i = i + 1
 }
  
  return(list(x_values, y_values))
  
}
position = definePosition(node_names)
Now i want to assign x_values to node_x, and y_values to node_y by below code, but doesn't work. what should be the correct assign?
node_x = position[0]
node_y = position[1]
 
    