r how to multiply two columns and create new column code example Example: how to multiply two columns in r df$new_column <- df$column1 * df$column2