I have a data frame that looks like iris for example. I want to create another column called C1 which is a multiplication of all setosa Sepal.Length by 2.5, all Versicolor Sepal.Length by 3.5 and all Virginica Sepal.Length by 4.5. Could someone help me with the coding, please?
Expected out
Sepal.Length Sepal.Width Petal.Length Petal.Width Species C1 5.1 3.5 1.4 0.2 setosa 5.1*2.5 4.9 3.0 1.4 0.2 setosa 4.9*2.5 '' '' '' '' '' ''
6.4 3.2 4.5 1.5 versicolor 6.4*3.5
6.9 3.1 4.9 1.5 versicolor 6.9*3.5
'' '' '' '' '' ''
7.1 3.0 5.9 2.1 virginica 7.1*4.5
6.3 2.9 5.6 1.8 virginica 6.3*4.5
'' '' '' '' '' ''