Hello everyone I am pretty new to R and i am working on an RMarkdown file that keeps giving me the error shown in the picture. The code runs perfectly in the code chunks but will not knit. I changed the "inner_join" to merge and that fixed it but the next error was can't subset columns that dont exist. Could someone please help me fix these issues.
It would be useful if (in addition to the code) you provided the output showing the head() results for each of your data frames.
Note that RMarkdown starts with a clean session so it may be that you have something defined locally that isn't available to the RMarkdown session, resulting in the compile error.
You might also comment out that last line of code and see if it knits, just in an effort to isolate where the problem is.
So I use the lower case view() in y code. I believe it is part of the dplyr library of functions. I run your example code and it run perfectly on my end using the tidyverse library.
Back to your question... did you comment out the last line (I'm assuming that's where the issue is?) Could you break it into 2 steps and see if the first works? And make sure the columns are in intermediate the result? Something like:
Alright lemme give that a try. To be honest i believe your advice to comment it out would be the best course of action, however i still want to know why this happened.
I FIGURED IT OUT!!!! So it turns out that in my RMarkdown I had added an nrow() before the view. Which means that the dataframe ended becoming a table of the nrow and not the real values. Such a learning experience. Thank you so much for the help. Is the anyway i can follow you or something so i can reach out when i have an issue and you have the time?