Hi,
I have been trying in all different ways to be able to start a project in Rstudio that can be saved in my repository on Github but nothing is working.
I tried to install git.exe on my laptop, but keep getting git.cmd.exe which is not accepted by Rstudio instead of git.exe, no matter which options I select during the installation.
Error: DataSci_CrimeStats.git is not a valid package name: it should contain only
ASCII letters, numbers and dot, have at least two characters
and start with a letter and not end in a dot.
Any specific suggestions? I really need a step by step guide to this process. Thanks!
I'm not 100% clear on what you're trying to do, but if it involves Git and R(Studio), there's not much better place to start than Happy Git With R written by RStudio's own Prof. Jenny Bryan.
I'm also happy to answer any specific questions you might have if you need - just let me know!
Thank you. I was starting to get on the right track with simply downloading Git for Windows, but I had gummed up Rstudio by selecting git.cmd.exe. So I
deleted Git, and reinstalled it according to Jenny's instructions, then was careful to choose git.exe in the bin file in my global options under Tools. Then
I was able to create a new project with the git repository option finally available! That in itself is major progress for me. Thanks again.
Thank you Jim. I now have other questions as I'm further along and wondering what to do with this html file I created, but I will search the RStudio site for that topic.
Yes. You see part of this assignment is to come up with a project, produce 2 graphics on the data, and post it on a public site like Github. They suggested using either Heroku apps or displaying a notebook. If I knew Python, I think it would have been much easier. I've done a little with Rnotebook, but I couldn't find much on how to connect that with GitHub, so I thought I would just try doing Rmd files. But now it looks like things are more complicated than I had thought. For this project, I only have a few hours left, before it's due as it's a competition. But I want to become knowledgeable about Github anyway as I am seeking to build skills in data science. So I will take some time to experiment. Again thanks for your helpful suggestions, and I will try them out.
An option you have in Rstudio when you create an Rmd document is to always save the markdown output of the notebook (a notebook is typically processed from Rmd -> markdown -> HTML). Markdown documents can be displayed nicely on Github.
To make sure the (usually intermediate) markdown file gets saved; when you have your Rmd file open, click on the small cog symbol (next to the Knit button) and select Outupt options..., from there, click Advanced and then make sure the Keep markdown source file box is selected/ticked.
You should then re-knit your Rmd notebook and should see the .md markdown document in your project folder. If you commit and add that to git/push to github, you should be able to see the results of your analysis online on github.
This workflow is covered in Happy Git with R in section 19 here.
I tried obtaining the md and other files, and was successful. But when I tried to commit and push them, I got the message "Your branch is ahead of 'origin/master' by 1 commit'. Someone on StackOverflow suggested entering 'git reset --hard HEAD' from the shell in RStudio. I did that but it didn't change anything, except now when I rerun the code with knitr (this is on the Cars code) I don't see my files on the stage to push like I used to. So I don't know if git reset caused that or not, but it seems I'm worse off than before.
From your description, you added some files to your local (i.e. on your computer) git repository and made 1 commit containing those files/changes. Your branch is now "ahead" of GitHub (what the message refers to as origin/master) by 1 commit in the sense that you haven't shared your changes to GitHub yet.
The git reset --hard HEAD will have only removed your changes that you hadn't commited, so you should in theory still have the files if you have made a commit of them.
I just tried pushing, then rerunning knitr, and finally got rid of that warning. But my newly recreated md file and associated folder are listed
in my file list pane, but are still not listed on the stage, which is what needs to happen before committing and pushing, right?
As I said, the files I needed in Github, I actually found there yesterday, including my md file with the display that includes all the html file puts out, and a png file containing just
my graph. But I did commit and push the 4 stages files anyway, and they were successfully sent. Github is in the process of listing them all on the first page, but I see that it
takes time for it to do that. I learned that there is a delay in the displaying of the files you send on the first page of Github, but they are all there under Commits.
And now I just discovered if I modify my code (I deleted one chunk and changed the code of another to a histogram) and knit that, my new run will cause my output to be staged,
and I successfully committed those, and saw my histogram in github.
So I thank you so much for all your patience and help. Also learned some interesting things about html from another user, so it looks like I'm hooked
I am trying to run a clone git. Basically i done the folowing:
1-Run Git Bach for Window
2.Clone repository from url on internet
3. On R wrote: library library(devtools) and them, install('AquaCropR') but i have obtained the following message as well as error:
install('AquaCropR')
√ checking for file 'C:\Users\Ingrid\Documents\R\win-library\EX\AquaCropR/DESCRIPTION' ...
installing to library 'C:/Users/Ingrid/Documents/R/win-library/3.6'
installing source package 'AquaCropR' ...
** using staged installation
|arning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/Ingrid/Documents/R/win-library/3.6/00LOCK-AquaCropR/00new/AquaCropR/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") :
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'AquaCropR'
removing 'C:/Users/Ingrid/Documents/R/win-library/3.6/AquaCropR'
Error in (function (command = NULL, args = character(), error_on_status = TRUE, :
System command error