For some reason the Support.Weight variable works in the first line, but does not work in the last line. I have provide the code and the error. I think the issue might be that I am trying to use floating variables and integers, but I am not sure how to fix this.
Error in `left_join()`:
! Join columns must be present in data.
✖ Problem with `Support.Weight`.
Run `rlang::last_error()` to see where the error occurred.
> View(Horizon_join)
Error in View : object 'Horizon_join' not found
Code:
Horizon_cast <- dplyr::select(Horizon, 'Support.Weight', 'industry', 'Renewal.Forecast.Weight')
Horizon_cast <- unique(Horizon_cast)
View(Horizon_cast)
Horizon_cast_wide <- dcast(Horizon_cast, formula = 'Support.Weight'~ 'industry', value.var = "Renewal.Forecast.Weight")
View(Horizon_cast_wide)
# Drop Question and Response Columns from DAT & Remove Duplicates
Horizon_col <- Horizon[, c(1:(ncol(Horizon)-2))]
Horizon_col <- unique(Horizon_col)
View(Horizon_col)
### Join Data & Add Columns ---
Horizon_join <- left_join(Horizon_col, Horizon_cast_wide, by = 'Support.Weight')
View(Horizon_join)