Open tim-ness opened 3 years ago
A couple of things -
Reflect a bit on whether you have provided a reproducible error. In this particular instance the code can be correct, but the order that you perform certain tasks matters. The typical error students encounter is repeating a step, which produces some errors.
Your code looks fine, but I cannot tell what you have done prior to the line that produces the error, thus I can't really diagnose the problem.
The term "masks" means that one function already exists and another function with the same name is being loaded. Perhaps you were not starting from a fresh R environment and you had the functions loaded already? Type ls()
to see current objects.
At the point you are trying to install the package, type dir()
. This should print out the current directory structure. Do you see the montyhall folder? If not, you might be in the wrong location, which would explain why devtools can't find the folder "montyhall" to install.
In the tutorial you have, it recommends running the steps from an R console, not R Studio. Were you doing that?
I am using an R console, which I think is part of my problem since it's my first time doing that.
I deleted all the files this morning and started over. After I put the descriptions in the R folder and try to set the working directory, it says, "Error in setwd ("montyhall") " cannot change working directory" and gives more masking errors. When I try 'dir()' it does not show "montyhall", it shows the files within "montyhall", and I am not sure how to change that.
Here is everything I've done in this new session.
Got it. You are sourcing the R functions instead of placing them in the R folder.
When you run the document() step it will source the scripts for you.
# step 2 move R script to montyhall/R folder
# after completing documentation of fields
When I try 'dir()' it does not show "montyhall", it shows the files within "montyhall", and I am not sure how to change that.
You use double-periods to move up one level in the directory structure:
setwd( ".." )
I struggled with this for quite some time, spending an hour on Zoom with Kirsten and then playing with it quite a bit after that. I realized that my R sessions were all opening with objects in them from the global environment. By starting the R sessions with 'rm(list=ls())' I seemed to be able to get everything to work.
When I went back into a new, clean R session and tried to download my own package, it looks like it installs it fine but then says it can't find 'create_game'. Not sure if it's supposed to be able to, but thought I'd check
It looks like all the files are in the repository and the description is there.
I'll probably submit what I have to meet the submission deadline.
After installing a package you still need to load it to use functions. Try:
library( montyhall )
I've gotten to the point where I've created the R scripts with the documentation and moved them into the R folder within the montyhall folder. I did get some errors, but the instructions said to keep going.
When I move to the next stop, I get another error that R can't find the entire folder now.
Not sure where to go from here.