Skip to content

Commit

Permalink
fill in tutorial 1-3
Browse files Browse the repository at this point in the history
  • Loading branch information
chendaniely committed Feb 2, 2025
1 parent 26466e4 commit fee4828
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
26 changes: 26 additions & 0 deletions tutorials/t1.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,29 @@ title: "Tutorial 1"
---

Computer Setup Help, Bash, and Git

## Create a repository

- Create a new repository on GitHub (e.g., `YYYY-MM-DD-git`).
You can create it with an existing `README.md` file (or create a new one later)

:::{.callout-tip}
Creating a repository with a date is a quick way to make a unique name
where you can practice and redo a tutorial again in the future.
:::

- Clone down the repository to your local computer

## Make Changes to a file

- Create a `README.md` file if you don't have one already
- Edit the `README.md` file by adding a line about your favorite food
- Add / commit / push your changes up to github

## Update changes from remote

- Now edit the `README.md` file on the remote github repository
- Add a new line by naming your favorite color
- Commit the changes on github.com
- Confirm your changes in github.com are made in the web interface
- pull down your changes to your local computer
37 changes: 36 additions & 1 deletion tutorials/t3.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,39 @@
title: "Tutorial 3"
---

Python and R Environments
Here we'll practice with programming language environments.

If `conda` and python does not apply to you, you may skip the `conda` and python portion of the tutorial.
If you are taking, have taken,
or planning to take a class that uses python it will still be worth practicing and familiarizing yourself with conda environments.



## R Environments: renv

1. Open up RStudio
2. run `getwd()` in the r console, and note the default starting working directory in R when not in a project.
3. Create an RStudio Project (either from an existing folder, or create a new folder)
3. run `getwd()` again and see how the working directory changes
4. Install the `renv` package (if you do not have it installed)
5. Note all the current installed R packages you have in the packages panel
6. Run the `renv::init()` in the current project (you can also choose to `library(renv)` and then `init()` as 2 separate steps
7. Now note the packages in the package panel
8. Install the `palmerpenguins` package in R
9. Library the `palmerpenguins` package
10. you should now have access to the `penguins` dataframe
11. update the lock file with `renv::snapshot()`
12. Open a new RStudio or close the current project
13. You should not be in your project now, and notice the packages listed listed. And notice how the packages change again when you open up the project you just made



## Python Environments: conda

1. Open up a terminal, you should be in a conda base environment
2. Run `python --version` and `which python` to check the python version you have and which one is actually being used
3. create a new conda environment with a different python version from the one you currently have in base
4. activate this environment
5. install jupyterlab and pandas in the new environment
6. create an environment.yml file for your new environment. it should only list the packages you explicitly installed (not list dependencies)
7. deactivate your python environment
4 changes: 3 additions & 1 deletion tutorials/t4.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
title: "Tutorial 4"
---

Virtual environments and docker containers
Virtual environments and docker containers.
We'll practice creating virtual environments again (just like last tutorial),
so we can compare it with creating docker containers.

## R Environments

Expand Down

0 comments on commit fee4828

Please sign in to comment.