data3 is a data frame with a column called new of which all elements are 1. The function should change all values of the column new to 2. When executing the code there is no error but the value of the column "new" is still 1.
When only executing data3$new = 2 everything works
insertElementToColumn = function(){
data3$new = 2
}
insertElementToColumn(new, data3)