I am working on the below data frame where i am trying to multiply the variable x1 with 1.1, x2 with 1.2 and x3 with 1.3 , but i get the below error
Can't convert from double to integer due to loss of precision
Could you please let me know the reason for this and a solution. If i use the integer values (1, 2, 3) then i dont get that error, but i have to use double values to multiply
test <- data.frame(x1=c(1,2,3,4,5,6),
x2=c(2,3,4,5,6,7),
x3=c(3,4,5,6,7,8))
test2 <- test %>% mutate(across(c(x1,x2,x3),.names='y_{.col}')*across(c(1.1,1.2,1.3)))