Steve, You are able to work with a github package the same as any github repo. If you clone the repo: git clone https://github.com/user/repo.git If using RStudio it is simple enough to create a new project in that new directory (if the .Rproj file does not exist, otherwise open that). Once you have the project open for that directory you can modify source files and rebuild and install as you like. If at the CMD line, you do as Bob instructed with R CMD install . I recommend, however, either creating a new branch for you changes (if you familiar with git management) or at least make sure to change the subversion of the package so it doesn't conflict with the 'original'. That way you 'know' which version of the package is installed at a given time. Naturally, if you feel your modifications are valuable you may want to actually fork the package on github and create a pull request of your changes for the maintainer to incorporate in to the next release. Hope this helps clarify things, Charles On Sat, Jul 18, 2015 at 8:49 AM, boB Rudis <bob at rudis.net> wrote:> You can go to the package directory: > > cd /some/path/to/package > > and do > > R CMD install . > > from a command-line there. > > Many github-based packages are also made using RStudio and you can > just open the .Rproj file (i.e. load it into R studio) and build the > package there which will install it. > > The same-named package will overwrite what you have previously installed. > > Just: > > devtools::install_github("owner/package") > > to go back to the original. > > On Fri, Jul 17, 2015 at 8:12 PM, Steve E. <searl at vt.edu> wrote: > > Hi Folks, > > > > I am working with a package installed via GitHub that I would like to > > modify. However, I am not sure how I would go about loading a 'local' > > version of the package after I have modified it, and whether that process > > would including uninstalling the original unmodified package (and, > > conversely, how to uninstall my local, modified version if I wanted to go > > back to the unmodified version available on GitHub). > > > > Any advice would be appreciated. > > > > > > Thanks, > > Steve > > > > > > > > -- > > View this message in context: > http://r.789695.n4.nabble.com/modifying-a-package-installed-via-GitHub-tp4710016.html > > Sent from the R help mailing list archive at Nabble.com. > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Bob and Charles, Thanks very much for taking the time to write, I greatly appreciate your help. I have been so spoiled by Rstudio for so long that I cannot recall the last time I had to use R CMD install. Although I installed this package from GitHub using devtools, I do not see that an .Rproj exists, and the R code is in the .rdb and .rdx formats. However, if I understand Charles correctly, one approach would be to (1) fork the repo, (2) clone it, (3) make my edits, (4) push the edits to my fork of the repo, then (5) (re)install the package from my forked repo (e.g., install_github("myreponame/packagename"))...then I should be able to call all the functions with my edits. If I wanted to go back to the original, published version of the package, then I can just reinstall from the source (e.g.,install_github("author/packagename"), and that will overwrite what I have done locally. Do I have that right? Thanks again for your thoughtful advice! Steve On Mon, Jul 20, 2015 at 5:52 AM, Charles Determan <cdetermanjr at gmail.com> wrote:> Steve, > > You are able to work with a github package the same as any github repo. > If you clone the repo: > > git clone https://github.com/user/repo.git > > If using RStudio it is simple enough to create a new project in that new > directory (if the .Rproj file does not exist, otherwise open that). Once > you have the project open for that directory you can modify source files > and rebuild and install as you like. If at the CMD line, you do as Bob > instructed with R CMD install . > > I recommend, however, either creating a new branch for you changes (if you > familiar with git management) or at least make sure to change the > subversion of the package so it doesn't conflict with the 'original'. That > way you 'know' which version of the package is installed at a given time. > > Naturally, if you feel your modifications are valuable you may want to > actually fork the package on github and create a pull request of your > changes for the maintainer to incorporate in to the next release. > > Hope this helps clarify things, > > Charles > > > > On Sat, Jul 18, 2015 at 8:49 AM, boB Rudis <bob at rudis.net> wrote: > >> You can go to the package directory: >> >> cd /some/path/to/package >> >> and do >> >> R CMD install . >> >> from a command-line there. >> >> Many github-based packages are also made using RStudio and you can >> just open the .Rproj file (i.e. load it into R studio) and build the >> package there which will install it. >> >> The same-named package will overwrite what you have previously installed. >> >> Just: >> >> devtools::install_github("owner/package") >> >> to go back to the original. >> >> On Fri, Jul 17, 2015 at 8:12 PM, Steve E. <searl at vt.edu> wrote: >> > Hi Folks, >> > >> > I am working with a package installed via GitHub that I would like to >> > modify. However, I am not sure how I would go about loading a 'local' >> > version of the package after I have modified it, and whether that >> process >> > would including uninstalling the original unmodified package (and, >> > conversely, how to uninstall my local, modified version if I wanted to >> go >> > back to the unmodified version available on GitHub). >> > >> > Any advice would be appreciated. >> > >> > >> > Thanks, >> > Steve >> > >> > >> > >> > -- >> > View this message in context: >> http://r.789695.n4.nabble.com/modifying-a-package-installed-via-GitHub-tp4710016.html >> > Sent from the R help mailing list archive at Nabble.com. >> > >> > ______________________________________________ >> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> > https://stat.ethz.ch/mailman/listinfo/r-help >> > PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> > and provide commented, minimal, self-contained, reproducible code. >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > >[[alternative HTML version deleted]]
You essentially have it but you can just click the 'build and install' button to rebuild on the changes you made. But technically it would still work pushing to your repo and using devtools. On Monday, July 20, 2015, Stevan Earl <searl at vt.edu> wrote:> Bob and Charles, > > Thanks very much for taking the time to write, I greatly appreciate your > help. I have been so spoiled by Rstudio for so long that I cannot recall > the last time I had to use R CMD install. Although I installed this package > from GitHub using devtools, I do not see that an .Rproj exists, and the R > code is in the .rdb and .rdx formats. > > However, if I understand Charles correctly, one approach would be to (1) > fork the repo, (2) clone it, (3) make my edits, (4) push the edits to my > fork of the repo, then (5) (re)install the package from my forked repo > (e.g., install_github("myreponame/packagename"))...then I should be able > to call all the functions with my edits. If I wanted to go back to the > original, published version of the package, then I can just reinstall from > the source (e.g.,install_github("author/packagename"), and that will > overwrite what I have done locally. Do I have that right? > > Thanks again for your thoughtful advice! > > > Steve > > On Mon, Jul 20, 2015 at 5:52 AM, Charles Determan <cdetermanjr at gmail.com > <javascript:_e(%7B%7D,'cvml','cdetermanjr at gmail.com');>> wrote: > >> Steve, >> >> You are able to work with a github package the same as any github repo. >> If you clone the repo: >> >> git clone https://github.com/user/repo.git >> >> If using RStudio it is simple enough to create a new project in that new >> directory (if the .Rproj file does not exist, otherwise open that). Once >> you have the project open for that directory you can modify source files >> and rebuild and install as you like. If at the CMD line, you do as Bob >> instructed with R CMD install . >> >> I recommend, however, either creating a new branch for you changes (if >> you familiar with git management) or at least make sure to change the >> subversion of the package so it doesn't conflict with the 'original'. That >> way you 'know' which version of the package is installed at a given time. >> >> Naturally, if you feel your modifications are valuable you may want to >> actually fork the package on github and create a pull request of your >> changes for the maintainer to incorporate in to the next release. >> >> Hope this helps clarify things, >> >> Charles >> >> >> >> On Sat, Jul 18, 2015 at 8:49 AM, boB Rudis <bob at rudis.net >> <javascript:_e(%7B%7D,'cvml','bob at rudis.net');>> wrote: >> >>> You can go to the package directory: >>> >>> cd /some/path/to/package >>> >>> and do >>> >>> R CMD install . >>> >>> from a command-line there. >>> >>> Many github-based packages are also made using RStudio and you can >>> just open the .Rproj file (i.e. load it into R studio) and build the >>> package there which will install it. >>> >>> The same-named package will overwrite what you have previously installed. >>> >>> Just: >>> >>> devtools::install_github("owner/package") >>> >>> to go back to the original. >>> >>> On Fri, Jul 17, 2015 at 8:12 PM, Steve E. <searl at vt.edu >>> <javascript:_e(%7B%7D,'cvml','searl at vt.edu');>> wrote: >>> > Hi Folks, >>> > >>> > I am working with a package installed via GitHub that I would like to >>> > modify. However, I am not sure how I would go about loading a 'local' >>> > version of the package after I have modified it, and whether that >>> process >>> > would including uninstalling the original unmodified package (and, >>> > conversely, how to uninstall my local, modified version if I wanted to >>> go >>> > back to the unmodified version available on GitHub). >>> > >>> > Any advice would be appreciated. >>> > >>> > >>> > Thanks, >>> > Steve >>> > >>> > >>> > >>> > -- >>> > View this message in context: >>> http://r.789695.n4.nabble.com/modifying-a-package-installed-via-GitHub-tp4710016.html >>> > Sent from the R help mailing list archive at Nabble.com. >>> > >>> > ______________________________________________ >>> > R-help at r-project.org >>> <javascript:_e(%7B%7D,'cvml','R-help at r-project.org');> mailing list -- >>> To UNSUBSCRIBE and more, see >>> > https://stat.ethz.ch/mailman/listinfo/r-help >>> > PLEASE do read the posting guide >>> http://www.R-project.org/posting-guide.html >>> > and provide commented, minimal, self-contained, reproducible code. >>> >>> ______________________________________________ >>> R-help at r-project.org >>> <javascript:_e(%7B%7D,'cvml','R-help at r-project.org');> mailing list -- >>> To UNSUBSCRIBE and more, see >>> https://stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read the posting guide >>> http://www.R-project.org/posting-guide.html >>> and provide commented, minimal, self-contained, reproducible code. >>> >> >> >[[alternative HTML version deleted]]