I created this data frame:

```
Count <- c(1:10)
Give <- c(0,0,5,0,0,5,0,5,0,5)
X <- c(rep(0,10))
Y <- c(rep(0,10))
Z <- c(rep(0,10))

X_Target <- 5
Y_Target <- 10
Z_Target <- 5

```

Basically I have 3 vectors (X,Y,Z) and a target for each one of them.
I want to have a new calculation for X,Y and Z that based on the vector Give.
Once the number on Give is bigger than 0 then it's need to be added to Vector X until it equel to X\_Target. Then - the calcultion need to move to the next vector (Y) and do the same, and then to next vector...

The output should be like the following:

```
   Count Give X Y  Z
     1    0   0 0  0
     2    0   0 0  0
     3    5   5 0  0
     4    0   5 0  0
     5    0   5 0  0
     6    5   5 5  0
     7    0   5 5  0
     8    5   5 10 0
     9    0   5 10 0
    10    5   5 10 5

```

In this example I have only 3 vectors but please keep in mind that I'll have at least 60 vectors so I need it to be automatic as it can.

Hope I manage to explain myself :)
Thnanks!
['https://Stackoverflow.com/questions/65195952', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14686993/']
A `string` is not a single `rune`, it may contain multiple `runes`. You may use a simple type [conversion](https://golang.org/ref/spec#Conversions) to convert a `string` to a `[]runes` containing all its runes like `[]rune(sample)`.

The `for range` iterates over the runes of a `string`, so in your example `runeValue` is of type `rune`, you may use it in your `converter` map, e.g.:

```
var converter = map[rune]rune{}
sample := "⌘こんにちは"
for _, runeValue := range sample {
    converter[runeValue] = runeValue
}
fmt.Println(converter)

```

But since `rune` is an alias for `int32`, printing the above `converter` map will print integer numbers, output will be:

```
map[8984:8984 12371:12371 12385:12385 12395:12395 12399:12399 12435:12435]

```

If you want to print characters, use the `%c` verb of [`fmt.Printf()`](https://golang.org/pkg/fmt/#Printf):

```
fmt.Printf("%c\n", converter)

```

Which will output:

```
map[⌘:⌘ こ:こ ち:ち に:に は:は ん:ん]

```

Try the examples on the [Go Playground](https://play.golang.org/p/1O2hH3SnPFv).

If you want to replace (switch) certain runes in a `string`, use the [`strings.Map()`](https://golang.org/pkg/strings/#Map) function, for example:

```
sample := "⌘こんにちは"

result := strings.Map(func(r rune) rune {
    if r == '⌘' {
        return 'a'
    }
    if r == 'こ' {
        return 'b'
    }
    return r
}, sample)

fmt.Println(result)

```

Which outputs (try it on the [Go Playground](https://play.golang.org/p/w2CTVJu9jgL)):

```
abんにちは

```

If you want the replacements defined by a `converter` map:

```
var converter = map[rune]rune{
    '⌘': 'a',
    'こ': 'b',
}
sample := "⌘こんにちは"

result := strings.Map(func(r rune) rune {
    if c, ok := converter[r]; ok {
        return c
    }
    return r
}, sample)

fmt.Println(result)

```

This outputs the same. Try this one on the [Go Playground](https://play.golang.org/p/ra-skPc0s_3).
Convert string to rune array:

`runeArray := []rune("пример")`