Skip to content

nealxun/software_setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Agenda

  1. Python
  2. R
  3. Git
  4. Others

Python

  • Install.
    • Install python.
    • 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
  • Upgrade.
    • Update python in terminal.
      • conda update python3
  • Calling.
    • Call jupyter notebook in terminal.
      • jupyter notebook
    • Call python in terminal.
      • python3

R

  • Install.
    • Install R.
    • Install RStudio.
    • Install packages in R console.
      • install.packages("package_name")
    • Check R version in R console.
      • version
    • Check package status and version in R console.
      • packageStatus()
      • packageVersion("package_name")
  • Upgrade.
    • Update R.
      • Reference.
      • Re-download and install R from CRAN.
      • Move all the package folders from your old R version to new R version.
        • Usually they are located at /Library/Frameworks/R.framework/Versions/x.xx/Resources/library
    • Update packages.
      • In R console, update.packages(checkBuilt = TRUE)
      • In RStudio, go to tools -> check for package updates.
  • 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.
    • Retrieve your credentials.
      • In R console, gitcreds::gitcreds_get(url = "https://github.com/")
  • Fix data.table package single thread issue.
    • Reference 1.
    • Reference 2.
    • Reference 3. Recommend to use.
      • Under /Users/username, press cmd+shift+period to see hidden files, then under .R folder (case sensitive), create a Makevars 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.
    • Remove package.
      • In R console, remove.packages("data.table")
    • Install package from the source.
      • In R console.
        • install.packages("data.table", type = "source", repos = "https://Rdatatable.gitlab.io/data.table")
    • Check thread numbers.
      • In R console, data.table::getDTthreads()

Git

  • 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.
    • 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).

Others

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages