Join and automatization

I have two databases that contain salaries, but one tells me that the minimum wage of a worker is 1 or 2, 3, 4... and the other that the minimum wage is 1,256.7 (one thousand two hundred and fifty-six and seven cents). I would, first, like to put these databases together(it works maybe because of a few rows, because I receive this error:

Error in bind_cols():
! Can't recycle ..1 (size 12) to match ..2 (size 231456).

Backtrace: when doing with the original data), and then ai would like to create a column that tells me that "1" wage means 1,256.7; "2" means 2,134...I did a loop in the example, but don't know how to create a mutate with the result of the loop

Example:

Data_Frame <- data.frame (
  Ocupation = c("Engineer", "Teacher", "Welrder"),
  Wage = c(4, 2, 1)
 
)
Data_Frame <- Data_Frame %>%  
    mutate(Wage = as.numeric(Wage))

Data_Frame2 <- data.frame (Wage = ("1256.7"))

Data_Frame2 <- Data_Frame2 %>%  
    mutate(Wage = as.numeric(Wage))

glimpse(Data_Frame)

glimpse(Data_Frame2)

glimpse()
Occ = bind_cols(Data_Frame, Data_Frame2)
Occ

Wage<- list(1,2,3,4.2)

for (x in Wage) {
  Wage <-1256.7 * x
  print(Wage)
}

Hi, can you provide a reproducible example of your dataset?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.