- Python
- R
- Git
- Others
- Install.
- Install python.
- From the offical webisite.
- Use homebrew.
- Install python packages in terminal.
python3 -m pip install pacakge_name
- Install jupyter notebook in terminal.
pip install notebook
- Check python version in terminal.
python3 --version
- Check python version in python/jupyter notebook.
import sys
sys.version
- Install python.
- Upgrade.
- Update python in terminal.
conda update python3
- Update python in terminal.
- Calling.
- Call jupyter notebook in terminal.
jupyter notebook
- Call python in terminal.
python3
- Call jupyter notebook in terminal.
- Install.
- Upgrade.
- Update R.
- Update packages.
- In R console,
update.packages(checkBuilt = TRUE)
- In RStudio, go to tools -> check for package updates.
- In R console,
- Git setup.
- Reference.
- Create a remote on github from the existing project.
- Given your R project is already using git.
- Given you use the
usethis
package AND you have configured a GitHub Personal Access Token (PAT) (see here for how to set it up). - In R console,
usethis::use_github(host = "https://github.com/")
. This will create a remote for your existing local git project.
- Store git credentials.
- In R console,
gitcreds::gitcreds_set(url = "https://github.com/")
- Switch between different remotes needs to reset the PAT.
- In R console,
- Retrieve your credentials.
- In R console,
gitcreds::gitcreds_get(url = "https://github.com/")
- In R console,
- Fix
data.table
package single thread issue.- Reference 1.
- Reference 2.
- Reference 3. Recommend to use.
- Under
/Users/username
, presscmd+shift+period
to see hidden files, then under.R
folder (case sensitive), create aMakevars
file. - Add gcc (option 5) info in
Makevars
file is working on work computer. - Add libomp (option 1) info in
Makevars
file is working on personal computer.
- Under
- Remove package.
- In R console,
remove.packages("data.table")
- In R console,
- Install package from the source.
- In R console.
install.packages("data.table", type = "source", repos = "https://Rdatatable.gitlab.io/data.table")
- In R console.
- Check thread numbers.
- In R console,
data.table::getDTthreads()
- In R console,
- Git setup.
- In Visual studio code, click explore, then open a folder, this will be the work directory and then you can initiate a git project.
- In Visual studio code, terminal -> new terminal, to open a command line window.
- In the terminal, use
git config --list
to see the configuration. - In the terminal, use
git init
to initialize a project. - In the terminal, to staging a specific file:
git add FILENAME
, to add all files:git add .
, to make a commit:git commit -m “commit message”
.
- Create a remote.
- First create a repo in GitHub.
- Caching credentials. See here.
- If use
gitcreds::gitcreds_set(url = "https://github.com/")
in R to update PAT, it seems that macOS keychain will also be updated.
- If use
- Pushing to GitHub.
- Add a remote, in terminal, run
git remote add origin YOUR URL
. (make sure to select the https one). - Git push, in terminal, run
git push -u origin main
(first time push),git push --all
(push all the branches).
- Add a remote, in terminal, run