--- tags: ucsd-carpentries-archived --- # UCSD Carpentries Bootcamp - R, Unix Shell, and Git (Oct 2022) **Workshop Details** Dates: October 10th - 13th, 2022 Days: Monday - Thursday Time: 1pm - 4pm **Workshop Agenda:** https://ucsdlib.github.io/2022-10-10-UCSD/ **Software Installation:** R Studio downloads: https://www.r-project.org/ - download the free version Online/Cloud R Studio interface: https://rstudio.cloud/ *This is an online interface that can be used when unable to download R Studio* Git software: https://git-scm.com/downloads **Lesson Data (download)** [Gapminder data](https://kthoma2484.github.io/2022-06-13-UCSD/data/gapminder-FiveYearData.csv) and [Feline-data](https://kthoma2484.github.io/2022-06-13-UCSD/data/feline-data.csv) ## Workshop Day 1 ### First name and Last Name/Organization/Dept./Email | Name (first & last) | Organization | Dept. | Email | Role | | ------------------------- | ------------ | ------------- | ------------------------ |------ | | (example) Kimberly Thomas | UCSD | IT | kkt008@ucsd.edu |Staff | Eastern Kang (instructor) | UCSD | Peds | dkangsim@health.ucsd.edu | | Sarah Segall | UCSD | PSYC | ssegall@ucsd.edu | | Tommaso Menara | UCSD | MAE | tmenara@ucsd.edu | | Ece Bayram | UCSD | Neurosciences | ebayram@health.ucsd.edu | | Zhaoning Wang | UCSD | CMM | zhw063@health.ucsd.edu | | Shemp Wilkinson | UCSD | COGS | swilkins@ucsd.edu | | Kalam Park | UCSD | COGS | kapark@ucsd.edu | | Kristy Hwang | UCSD | Neuroscience | krhwang@health.ucsd.edu| | Jake Maurer | UCSD | Economics | jjmaurer@ucsd.edu | |Taelor Getz | UCSD | Pediatrics | tgetz@health.ucsd.edu | | Meyer Friedman | UCSD | MED |m3friedman@ucsd.edu | | Federica Klaus | UCSD | Psychiatry | fklaus@ucsd.edu | |Sara Ramos | UCSD | Neurosciences | sramoscabo@ucsd.edu | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Day 1 Questions: Please enter any questions not answered during live session here: 1. ### End Day 1 ## Workshop Day 2 ### First name and Last Name/Organization/Dept./Email | Name (first & last) | Organization | Dept. | Email | | ------------------------- | ------------ | ----- | --------------- | | Melodi Frey | UCSD | CMM | mtastemel@health.ucsd.edu | | Sara Ramos | UCSD | Neuro.|sramoscabo@ucsd.edu | | Tommaso Menara | UCSD | MAE | tmenara@ucsd.edu | | Sarah Segall | UCSD | PSYC | ssegall@ucsd.edu | | Jake Maurer | UCSD | ECON | jjmaurer@ucsd.edu |Federica Klaus | UCSD | Psychiatry | fklaus@ucsd.edu | | | Ece Bayram | UCSD | Neurosciences | ebayram@health.ucsd.edu | | Kristy Hwang | UCSD | Neuroscience | krhwang@health.ucsd.edu | | Shemp Wilkinson | UCSD | COGS | swilkins@ucsd.edu | |Rukmini Ravi |UCSD |San Diego Supercomputer Center |r2ravi@ucsd.edu |Staff |Kalam Park | UCSD | COGS | kapark@ucsd.edu | | Meyer Friedman |UCSD | MED | m3friedman@ucsd.edu | | Taelor Getz | UCSD | Pediatrics | 👌😒 | | | | |Zhaoning Wang | UCSD | CMM |zhw063@health.ucsd.edu | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Quick recap: The package `dplyr` provides easy tools for the most common data wrangling tasks. Some of the most common functions are: * `select()`: subset columns * `filter()`: subset rows on conditions * `mutate()`: create a new column (variable) by using information from other columns * `group_by()` and `summarize()`: create summary statistics on grouped data ### Pipes (%>%) What if you want to select and filter at the same time? With multiple steps, it is easy to clutter up the workspace with lots of objects that you have name individually. The `pipes` let y ou take the output of one function and send it directly to the next, which is useful when you need to do many things to the same dataset. It looks like `%>%`. ## Day 2 Questions: Please enter any questions not answered during live session here: 1. How can a variable that is a number with attributes (e.g. import from SPSS, numbers with titles) be converted to a factor to be used as x-label in plot? (Federica) ### End Day 2 ## Workshop Day 3 ### First name and Last Name/Organization/Dept./Email | Name (first & last) | Organization | Dept. | Email | | ------------------------- | ------------ | ----- | --------------- | | Shemp Wilkinson | UCSD | COGS | swilkins@ucsd.edu | | Sarah Segall | UCSD | PSYC | ssegall@ucsd.edu | | Kristy Hwang |UCSD |Neuroscience |krhwang@health.ucsd.edu | | Zhaoning Wang |UCSD | CMM |zhw063@health.ucsd.edu | | Jake Maurer | UCSD | ECON | jjmauerer@ucsd.edu | | Kalam Park | UCSD | COGS | kapark@ucsd.edu | | Taelor Getz|UCSD|Pediatrics|tgetz@health.ucsd.edu |Federica Klaus | UCSD | Psychiatry |fklaus@ucsd.edu | Meyer Friedman | UCSD | MED | m3friedman@ucsd.edu | | Ece Bayram | UCSD |Neurosciences |ebayram@health.ucsd.edu | |Rukmini Ravi |UCSD |San Diego Supercomputer Center |r2ravi@ucsd.edu | | Sara Ramos |UCSD |Neuro. | sramoscabo@ucsd.edu | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Day 3 Questions: Please enter any questions not answered during live session here: 1. ### End Day 3 --- ## Workshop Day 4 - Git ## download data: https://librarycarpentry.org/lc-shell/data/shell-lesson.zip ### First name and Last Name/Organization/Dept./Email | Name (first & last) | Organization | Dept. | Email | | ------------------------- | ------------ | ----- | --------------- | | Jake Maurer | UCSD | ECON | jjmaurer@ucsd.edu | |Kristy Hwang |UCSD |Neuroscience | krhwang@health.ucsd.edu | | Shemp Wilkinson | UCSD | COGS | swilkins@ucsd.edu | | Tommaso Menara | UCSD | MAE | tmenara@ucsd.edu | | Ece Bayram | UCSD | Neurosciences | ebayram@health.ucsd.edu | | Sarah Segall | UCSD | PSYC | ssegall@ucsd.edu | | Kalam Park | UCSD | COGS | kapark@ucsd.edu| | Taelor Getz|UCSD|Pediatrics|tgetz@health.ucsd.edu | Meyer Friedman | UCSD | MED |m3friedman@ucsd.edu | Sara Ramos | UCSD |Neuro. |sramoscabo@ucsd.edu | | Rukmini Ravi | UCSD | San Diego Supercomputer Center |r2ravi@ucsd.edu | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Collaborative Lesson notes: download data: https://librarycarpentry.org/lc-shell/data/shell-lesson.zip shell commands: MacOS - run `Terminal application` Windows - `Gitbash` application ```bash= pwd #print working directory show directory path ls #or "list" will display directory contents ls -l #list detailed directory information `-l` is a flag that add additional commands cd #change directory - move around the file system cd .. #move up in the folder hierarchy cd ../.. #moves high up in the folder hierarchy skipping directories clear #move prompt to the top, clearing the terminal window ls -F #will show folders using a `/` man ls # typing man and the command will display the help information about the command. mkdir #create new file directory rmdir #permanently delete files *becareful with this* cat #view contents in a file with out opening it head #shows the first 10 lines at the begining of the file tail #shows the last 10 lines at the end of the file cp #rename files nano # built-in Shell text editor vim # advanced built-in text editor ``` #### Shell cheatsheet: https://www.ifixit.com/Wiki/MacOS_Unix_Commands --- ## Git lesson initial git setup --global config you only have to do this once, unless your git and github account info is updated or changed. ```bash= #setup global config properties git config --global user.email git config --global core.editor "nano -w" git config --global init.defaultBranch main git init #initialize folder for git version tracking. note: make sure to init a single folder, do not init nested folders. git checkout -b # change branch to main branch ## git steps for adding and commiting git status # get current status of file tracking changes git add #adding changes to be tracked git status git commit -m "[enter breif note]" # commit changes that were made to the file git status git log #check the commit log information lists information about the commit git ignore #ignore file will not track listed content git remote add origin [paste remote repository] #only needed for each new remote repository git remote -v # view remote url connection to Github git push origin main #push to github online branch repository git pull origin main #if collaborating pull latest branch to your local machine ``` **git one time commands:** git init git checkout git ignore #ignore file will not track listed content **git remote commands:** git remote add origin [paste remote repository] #only needed for each new remote repository git remote -v # view git push origin main #push to github online branch git pull origin main #if collaborating pull latest branch to your local machine **Here is the list of basic git commands to commit a file for version control:** git status git add git commit -m "[commit message]" git status git log git diff ## Day 4 Questions: Please enter any questions not answered during live session here: 1.Will there be a quiz today? **CCR Quiz will be sent out with the workshop survey after the end of today.** ### End Day 4