Open aawoods97 opened 3 years ago
Hello Asia @aawoods97,
Are you working within an RStudio project?
Also, can you provide the following:
Thanks! Courtney
The path for my data dictionary: "/Users/asiawoods/Documents/GitHub/CPP527/rodeo/ltdb-data-dictionary.csv" I watched the video that mentioned this should not be a path that directly correlates with my computer, but one that connects to GitHub. However, I am not sure how to do that.
Code for the input: `DD_FILEPATH <- here::here( "data/rodeo/ltdb_data_dictionary.csv" )
dd <- read.csv( DD_FILEPATH, stringsAsFactors=F )`
Hello Asia,
Thanks!
The best way to think about the here package is that it splits your code path into two.
So here has stored: /Users/yourusername/Documents/GitHub/CPP527
You will need to enter the second half of the path to complete the code. I believe your error is coming from the '/data/' file as it appears your file is stored directly in rodeo.
Try the following code to complete your code path:
DD_FILEPATH <- here::here( "rodeo/ltdb_data_dictionary.csv" )
To connect your RStudio to Github, you can download Git here: https://git-scm.com/downloads and then this video shows how to set up a Github project from your team's repository: https://www.youtube.com/watch?v=A5W8mQf8ej8&t=2s
Let me know if you have any further questions! Courtney
I tried the file path, but it still did not work. I also attempted to create a GifHub project as instructed in the video. However, I am receiving the following error:
/usr/bin/git clone --progress https://github.com/R-Class/cpp-528-fall-2021-group-03 cpp-528-fall-2021-group-03 Cloning into 'cpp-528-fall-2021-group-03'... remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information. fatal: Authentication failed for 'https://github.com/R-Class/cpp-528-fall-2021-group-03/'
I have signed up for two-factor authorization and used one of the tokens as the password, but I am still not able to create a project. How can I go about fixing this error to create a project?
Hello @aawoods97
You can try the steps here to set your access token: https://gist.github.com/Z3tt/3dab3535007acf108391649766409421
If that still does not work, you can install GitHub Desktop and pull the repository from there by selecting existing directory: https://support.rstudio.com/hc/en-us/articles/200526207-Using-Projects?mobile_site=true
Does the here package code work if you enter the entire file path?
I believe I have already pulled the repository using GitHub Desktop, as pictured below. I am able to push and pull things to and from the GitHub page.
If I use the code below, the data dictionary uploads to the global environment properly and I am able to run my functions using that data.
dd <- read.csv("/Users/asiawoods/Documents/GitHub/CPP527/cpp-528-fall-2021-group-03/data/rodeo/ltdb-data-dictionary.csv")
Hello Asia,
Great! I'm glad Github Desktop is working. If you hover over 'Current Repository cpp-528-fall-2021-group-03' it will show you the location of the repository on your computer. You can then add it to RStudio by clicking Project > New Project > Existing directory and then selecting the location of the repository:
Also, your original listed file location was missing the cpp-528-fall-2021-group-03 folder.
If here() still results in /Users/yourusername/Documents/GitHub/CPP527
,
Your code should be:
DD_FILEPATH <- here::here( "cpp-528-fall-2021-group-03/data/rodeo/ltdb_data_dictionary.csv" )
dd <- read.csv( DD_FILEPATH, stringsAsFactors=F)
I think I might have missed something because I am still getting the same output. I added a project, but it appeared within the cpp-528-fall-2021-group-03 folder.
I am also receiving the error when attempting to read the csv `# store data dictionary file path DD_FILEPATH <- here::here( "cpp-528-fall-2021-group-03/data/rodeo/ltdb_data_dictionary.csv" )
dd <- read.csv( DD_FILEPATH, stringsAsFactors=F)
dd <- select( dd, -root2 )
dd[ c(1:5,15:17), ] %>% pander()`
Also when I call the here() function I am given the following: here() starts at /Users/asiawoods/Documents/GitHub/CPP527
Hello Asia, Do you have the project open in RStudio?
I have opened the project in another window in RStudio. When the window opens it there are no files opened, but I do see something in the lower right hand corner with either the path to the project or something similar, I don't have access to my computer or else I would include a picture.
I have opened both files in the new window for the project.
I am not sure if this is helpful, but when I edit the files, I receive updates on the GitHub Desktop with the option to push it to GitHub.
When you run here() in the new window are you given the same file path as before?
When I run here() I get the following: "/Users/asiawoods/Documents/GitHub/CPP527"
I have attached an image of the lower right-hand corner I mentioned earlier.
@aawoods97 Do you see the project listed in the top right corner of Rstudio?
You should see something similar to the highlight in the top right here:
Here is a screenshot of a project loaded in the top right corner:
This is what I see in the top right corner.
The name of my project is "cpp-528-template.Rproj" and is included in the cpp-520...group-03 folder
Okay, perfect. Your project is loaded. Have you installed the renv package?
If so, try:
detach("package:here", unload=TRUE)
library(here)
here()
This was my result:
The file name of the data dictionary uses dashes instead of hyphens... I fixed the file name and it works........ Thank you for your time!!
Ah, good catch @aawoods97! Glad it's working.
Good evening Professor,
I am attempting to import the data dictionary in my lab rmd file. I am receiving the following error: "Error in file(file, "rt") : cannot open the connection". How can I ensure my rmd file is able to locate the data dictionary?
Thank you for your assistance! Asia Woods