I’m now doing the Guided Project NYC Schools Perceptions. I conducted the same steps provided in the course but now I get an error that the object ‘variable’ is not found. In the course the code worked.
cor_mat <- combined %>% select_if(is.numeric) %>% cor(use = "pairwise.complete.obs") cor_tib <- cor_mat %>% as_tibble(rownames = "variable") sat_cors <- cor_tib %>% select(variable, avg_sat_score) %>% filter(avg_sat_score > 0.25 | avg_sat_score < -0.25)
What I expected to happen:
- Select the columns that contain relationships between all variables paired with
avg_sat_scoreand the names of the variables.
- Filter the selected columns to retain only rows with correlation coefficient values greater than 0.25 or less than -0.25.
What actually happened:
Error in FUN(X[[i]], ...) : object 'variable' not found
I hope you can help me with this error! Thanks in advance!