This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # library() or require() only load one package at a time | |
| # but... | |
| Packages <- c("dplyr", "ggplot2", "rstan", "readr") | |
| lapply(Packages, library, character.only = TRUE) | |
| # this loads as many as you put in 'Packages'. They need to be installed first, of course. |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # check.packages function: install and load multiple R packages. | |
| # Check to see if packages are installed. Install them if they are not, then load them into the R session. | |
| check.packages <- function(pkg){ | |
| new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
| if (length(new.pkg)) | |
| install.packages(new.pkg, dependencies = TRUE) | |
| sapply(pkg, require, character.only = TRUE) | |
| } | |
| # Usage example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #http://stackoverflow.com/a/6457473/127508 | |
| git checkout 56e05fced -- . | |
| git add . | |
| git commit -m 'Revert to 56e05fced' | |
| And to prove that it worked: | |
| git diff 56e05fced |