I tried to cut the following repetitive codes to a function, but apparently I did something wrong that it is not working. As dataplot is a list and I need to repeat gather
gather