diff --git a/.github/workflows/custom-pages.yml b/.github/workflows/custom-pages.yml new file mode 100644 index 0000000..da91912 --- /dev/null +++ b/.github/workflows/custom-pages.yml @@ -0,0 +1,49 @@ +name: Build-and-Deploy + +on: + push: + branches: [ test ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 # freeze R + with: { r-version: "4.4.2" } + + - uses: r-lib/actions/setup-pandoc@v2 # Quarto needs Pandoc + + - uses: quarto-dev/quarto-actions/setup@v2 + + # speed: reuse compiled packages + - name: Cache renv packages + uses: actions/cache@v4 + with: + path: | + ~/.cache/R/renv + renv/cache + key: ${{ runner.os }}-renv-${{ hashFiles('renv.lock') }} + restore-keys: ${{ runner.os }}-renv- + + # restore packages exactly as in renv.lock + - name: Restore R packages + run: Rscript -e 'renv::restore(prompt = FALSE)' + + # build the site + - name: Render site + run: quarto render + + - name: List rendered files # optional debug + run: ls -la docs + + # deploy + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + publish_branch: gh-pages diff --git a/_quarto.yml b/_quarto.yml index 261c0ea..7e80f26 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -3,7 +3,7 @@ project: output-dir: docs book: - site-url: https://h2l2cR.com + site-url: https://how-to-learn-to-code.github.io/Rclass-DataScience/ sidebar: tools: - icon: github diff --git a/class0.qmd b/class0.qmd index e95c754..f1b5fc6 100644 --- a/class0.qmd +++ b/class0.qmd @@ -7,7 +7,7 @@ format: ## Introduction -This page will walk you through setting up access to UNC's computing cluster and introduce you a bit to R and R Studio so we can hit the ground running in the first class. To ensure you have access to the UNC cluster (and thus able to participate in class), **please review this document in full at least 24 hours in advance of the first class**--Research IT will need time to approve your account request. +Test test This page will walk you through setting up access to UNC's computing cluster and introduce you a bit to R and R Studio so we can hit the ground running in the first class. To ensure you have access to the UNC cluster (and thus able to participate in class), **please review this document in full at least 24 hours in advance of the first class**--Research IT will need time to approve your account request. ## Class 0 Objectives @@ -119,9 +119,9 @@ Below is some jargon that you may hear during class. Don't worry about memorizin **Functions:** A function performs a given task. This task can be very simple (add two numbers) or more complex (create a large data frame, run a linear regression, save the output to a csv file). R has many built-in functions you will use. Many packages also have functions you can use. -**Packages:** Packages in R are extensions of what is called "base R." Base R refers to using R without any add-ons (i.e., no packages). Packages can have data, functions, and/or compiled code. It is the responsibility of package developers to maintain their package--which means some undergo frequent updates and some haven't been touched in years (and thus might not work anymore for whatever reason). It also means that some packages can have bugs or might not be appropriate for your data/analysis. To use a package, you will first need to install it using the function `install.package("")`. You will only need to install the package once. Each time you want to use the package, you'll need to load it into your environment: `library(")`. You will only need to install the package once. Each time you want to use the package, you'll need to load it into your environment: `library( -If you want a more detailed install walkthrough: +If you want a more detailed install walkthrough: \ No newline at end of file diff --git a/class1.qmd b/class1.qmd index 57f568c..fe59a07 100644 --- a/class1.qmd +++ b/class1.qmd @@ -281,4 +281,4 @@ Since this is a built-in dataset, we can get some help. Try running the code bel ?mean() ``` -Adding a `?` before the name of a function or data frame (built-in or from a package) pulls up a help file in the Help tab of the Output pane. If you aren't sure what a function does, this should be your first step. +Adding a `?` before the name of a function or data frame (built-in or from a package) pulls up a help file in the Help tab of the Output pane. If you aren't sure what a function does, this should be your first step. \ No newline at end of file diff --git a/class2.qmd b/class2.qmd index 69fd867..18246ff 100644 --- a/class2.qmd +++ b/class2.qmd @@ -78,7 +78,7 @@ data(package = "palmerpenguins") Your former lab mate Weird Barbie graduated a few years ago. Before she left, she was working on some interesting analyses of the frequencies of Kens. -This is a test! +This is a test ![photo credit: Warner Bros.](data/class2_files/weirdbarbie.jpeg){fig-align="center"}