Closed nszekeres closed 4 years ago
Did you load the tidyverse library first via library(tidyverse)
?
yes, I had loaded it. I also tried reloading it, restarting, etc. Eventually, using the above worked for me, but I had to manually do it for every function... still figuring this out.
I've been having a lot of issues with my installs; I wonder if it is some fundamental compatibility issue.
That's odd. You might try reinstalling tidyverse (just use install.packages("tidyverse")
again). If that doesn't work, you might want a reinstall of everything. But before that, we should set a meeting so I can see the problem in real time.
Can I ask how you were able to fix this? I'm having the same issue with a file that worked perfectly fine on Sunday.
@nszekeres, I can't remember what you did to get it working. Was it just shutting down RStudio and then making sure you ran the file from the top? Did you need an update?
@btskinner - I continue to try to troubleshoot this issue. I figured out that even though my working directory is set to the scripts folder, the code is defaulting to the assignments folder. An error is shown at the bottom of the attached jpeg.
Is your assignment in the scripts directory or in the assignments directory? If in the assignments directory, is that directory at the same level as the data directory, like this:
EDH7916_Research
|
|__/data
|__/scripts
|__/assignments
If so, the code should still work for you. But I think you might be down one more directory than that, in assignments/assignment6. If that's true, then you could try to add another set of dots to the file path:
dat_dir <- file.path("..", "..", "data")
Another possibility: Did you download and place hsls_small.dta
in your data directory?
I'm not sure if you can read the screen shot with my notes attached. My assignment is located inside EDH7916<assignments<assignment6, so I tried adding another set of dots (as you note above) and that still did not work. I have not had this issue on any other assignment (while maintaining the same file directory), nor am I having trouble accessing the data my final project initial analysis.
It is letting me import my data using the following code:
df <- read_dta(choose())
Using this code, I was able to respond to all the questions on assignment 6, however, it is kicking out an error when I try to use "knit" so I am unable to generate the pdf without addressing the data file issue. If you have any other ideas, I certainly welcome them. I'm sure it's some mistake on my part.
Figured it out! I was missing the haven library and had to add the second set of dots for the file path. Thank you!!!
@ckedroski, those are the hardest errors: when there's more than one issue at the same time. But I'm glad you got it working. I'll close this issue for now.
Hello,
I encountered this error when trying to read NCES data: Error in read_csv() : could not find function "read_csv"
I found this response online:
"this means that the readr package has not been attached to the R session; remedy with library(readr)."
Am curious if this is the right answer or if anyone else has insight as to why I am hitting an error.
TY, Naomi