Question: I wish to learn a more efficient to get averaged values that have different suffixes, such as \_L and \_R.

For every brain region, I would like to create a new variable that is the averaged between the left and right hemispheres. This is denoted by the suffix `_L` and `_R`.

I am doing this manually in excel but it could be error prone.

The dataset is currently in a long format. Example: For each subject, the goal is to create a new `region` called `odi.lobar.Temporal_Average` which is the averaged of `0.030767` and `0.371568`.

```
subject region  value
1   odi.lobar.Temporal_L    0.030767
1   odi.lobar.Temporal_R    0.371568
2   odi.lobar.Temporal_L    0.371568
2   odi.lobar.Temporal_R    0.369251

```

Many thanks.

Answer: 
Do you have a trigger set up for it? The function you have only shows a simple trigger `onEdit()` which cannot send emails. [See Restrictions here.](https://developers.google.com/apps-script/guides/triggers#restrictions)
Vytautas is right. It says that:

*They cannot access services that require authorization. For example, a simple trigger cannot send an email because the Gmail service requires authorization, but a simple trigger can translate a phrase with the Language service, which is anonymous.*