Skip to content

Commit

Permalink
Trying GitPages
Browse files Browse the repository at this point in the history
  • Loading branch information
helenewegener committed Oct 3, 2024
1 parent 0b75732 commit 783154d
Show file tree
Hide file tree
Showing 116 changed files with 9,284 additions and 737 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions Teachers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.quarto/
6 changes: 6 additions & 0 deletions Teachers/.quartoignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

Teachers/Presentation/presentation3.qmd
Teachers/Presentation/presentation5.qmd
Teachers/Presentation/video_test.qmd

Teachers/Exercises/*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: "Presentation 1"
format: html
editor: visual
project:
type: website
output-dir: docs
---

## Introduction
Expand Down Expand Up @@ -151,7 +153,7 @@ getwd()
The working directory can changed but when working with Quarto this only influences individual code chunks (which is mentioned in a warning when executing the code below). However it is really useful when working with raw R scripts which are taught in the upcoming R for data science (R part 2) course.

```{r}
setwd('../Exercises/')
# setwd('../Exercises/')
getwd()
```

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: "Presentation 2"
format: html
editor: visual
project:
type: website
output-dir: docs
---

## Working with data in R
Expand All @@ -28,7 +30,7 @@ getwd()
Often we will work with large datasets that already exist in i.e. an excel sheet or a tab separated file (.tsv). We can easily load that data into R, either with the read_excel function or by clicking on 'Import Dataset' in the Environment tab (right). We can also load data in via a command. Let's do this now. Navigate to the data from your working directory. Use the tap-button to check what your options are.

```{r}
crohns <- read_excel("../Data/crohns_disease.xlsx")
crohns <- read_excel("../../Data/crohns_disease.xlsx")
```

## A first look at the data
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Presentation 4"
format: html
editor: visual
project:
type: website
output-dir: docs
---

## Presentaion 4: ggplot2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The data are saved in the file **psoriasis.xlsx**. At first the variable named `

```{r}
# Read in the data from Excel file and call it psoriasisData
psoriasisData <- read_excel("./data/psoriasis.xlsx")
psoriasisData <- read_excel("../../Data/psoriasis.xlsx")
# View the top rows of the dataset
head(psoriasisData)
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions Teachers/Slideshow/material_for_slides.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ title: "Presentation 4"
format: html
---

```{r}
library(tidyverse)
```

### ggplot2 additive structure

```{r}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions Teachers/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
project:
type: website
output-dir: docs

website:
title: "FromExceltoR"
navbar:
left:
- href: main_page.qmd
text: FromExcel2R
sidebar:
style: "floating"
right:
- text: "Presentations"
contents:
- href: Presentations/presentation1.qmd
text: "Presentation 1"
- href: Presentations/presentation2.qmd
text: "Presentation 2"

format:
html:
theme: cosmo # You can try different themes like cosmo, flatly, etc.



162 changes: 128 additions & 34 deletions Teachers/exercises1.html → Teachers/docs/Exercises/exercises1.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.555">
<meta name="generator" content="quarto-1.5.57">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

<meta name="author" content="Data Science Lab, University of Copenhagen">
<meta name="dcterms.date" content="2024-09-20">
<meta name="dcterms.date" content="2024-10-03">

<title>I. Working with data in R (exercises)</title>
<title>I. Working with data in R (exercises) – FromExceltoR</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
Expand All @@ -35,7 +35,7 @@
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
Expand All @@ -59,24 +59,100 @@
</style>


<script src="exercises1_files/libs/clipboard/clipboard.min.js"></script>
<script src="exercises1_files/libs/quarto-html/quarto.js"></script>
<script src="exercises1_files/libs/quarto-html/popper.min.js"></script>
<script src="exercises1_files/libs/quarto-html/tippy.umd.min.js"></script>
<script src="exercises1_files/libs/quarto-html/anchor.min.js"></script>
<link href="exercises1_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="exercises1_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="exercises1_files/libs/bootstrap/bootstrap.min.js"></script>
<link href="exercises1_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="exercises1_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script src="../site_libs/quarto-nav/quarto-nav.js"></script>
<script src="../site_libs/quarto-nav/headroom.min.js"></script>
<script src="../site_libs/clipboard/clipboard.min.js"></script>
<script src="../site_libs/quarto-search/autocomplete.umd.js"></script>
<script src="../site_libs/quarto-search/fuse.min.js"></script>
<script src="../site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="../">
<script src="../site_libs/quarto-html/quarto.js"></script>
<script src="../site_libs/quarto-html/popper.min.js"></script>
<script src="../site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="../site_libs/quarto-html/anchor.min.js"></script>
<link href="../site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="../site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="../site_libs/bootstrap/bootstrap.min.js"></script>
<link href="../site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="../site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script id="quarto-search-options" type="application/json">{
"location": "navbar",
"copy-button": false,
"collapse-after": 3,
"panel-placement": "end",
"type": "overlay",
"limit": 50,
"keyboard-shortcut": [
"f",
"/",
"s"
],
"show-item-context": false,
"language": {
"search-no-results-text": "No results",
"search-matching-documents-text": "matching documents",
"search-copy-link-title": "Copy link to search",
"search-hide-matches-text": "Hide additional matches",
"search-more-match-text": "more match in this document",
"search-more-matches-text": "more matches in this document",
"search-clear-button-title": "Clear",
"search-text-placeholder": "",
"search-detached-cancel-button-title": "Cancel",
"search-submit-button-title": "Submit",
"search-label": "Search"
}
}</script>


</head>

<body class="fullcontent">

<div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
<body class="nav-sidebar floating nav-fixed fullcontent">

<div id="quarto-search-results"></div>
<header id="quarto-header" class="headroom fixed-top">
<nav class="navbar navbar-expand-lg " data-bs-theme="dark">
<div class="navbar-container container-fluid">
<div class="navbar-brand-container mx-auto">
<a class="navbar-brand" href="../index.html">
<span class="navbar-title">FromExceltoR</span>
</a>
</div>
<div id="quarto-search" class="" title="Search"></div>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" role="menu" aria-expanded="false" aria-label="Toggle navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav navbar-nav-scroll me-auto">
<li class="nav-item">
<a class="nav-link" href="../main_page.qmd">
<span class="menu-text">FromExcel2R</span></a>
</li>
</ul>
</div> <!-- /navcollapse -->
<div class="quarto-navbar-tools">
</div>
</div> <!-- /container-fluid -->
</nav>
<nav class="quarto-secondary-nav">
<div class="container-fluid d-flex">
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" role="button" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<i class="bi bi-layout-text-sidebar-reverse"></i>
</button>
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item">I. Working with data in R (exercises)</li></ol></nav>
<a class="flex-grow-1" role="navigation" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
</a>
</div>
</nav>
</header>
<!-- content -->
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article page-navbar">
<!-- sidebar -->
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation floating overflow-auto">
</nav>
<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item"></div>
<!-- margin-sidebar -->

<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block default">
Expand All @@ -98,7 +174,7 @@ <h1 class="title">I. Working with data in R (exercises)</h1>
<div>
<div class="quarto-title-meta-heading">Published</div>
<div class="quarto-title-meta-contents">
<p class="date">September 20, 2024</p>
<p class="date">October 3, 2024</p>
</div>
</div>

Expand Down Expand Up @@ -229,7 +305,7 @@ <h2 class="anchored" data-anchor-id="getting-help-in-r">Getting help in R</h2>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="fu">median</span>(x)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>The first command defines a vector with six elements, but where the last number is missing (NA = Not Available). Since the last number is missing, <code>median</code> returns <code>NA</code>. However, could we make <code>median</code> find the median of the remaining numbers. Perhaps the help page can help out!</p>
<ol start="21" type="1">
<ol start="25" type="1">
<li>Look at the help for the <code>median</code> function:</li>
</ol>
<div class="cell">
Expand All @@ -243,6 +319,12 @@ <h2 class="anchored" data-anchor-id="getting-help-in-r">Getting help in R</h2>
<p>In order to use the help pages as above, you need to know the name of the function, which obviously may not be the case: You want to compute the median but have no idea what function to use. The best way to proceed: Google! Use “R whatever-you-want-to-search-for”, and you often get exactly what you need.</p>
<p>While working with R, you will get a lot of error messages. Some are easy to understand, and you will readily be able to fix the problems, while others… Again, the best answer is: Google and ChatGPT! Copy the error message into Google or ChatGPT, and you will often find help.</p>
</section>
<section id="wrapping-up" class="level2">
<h2 class="anchored" data-anchor-id="wrapping-up">Wrapping up</h2>
<ol start="26" type="1">
<li>Imagine you need to send your code to a collaborator. Review your code to ensure it is clear and well-structured, so your collaborator can easily understand and follow your work.</li>
</ol>
</section>
<section id="lessons-learnt" class="level2">
<h2 class="anchored" data-anchor-id="lessons-learnt">Lessons learnt</h2>
<ul>
Expand All @@ -251,10 +333,11 @@ <h2 class="anchored" data-anchor-id="lessons-learnt">Lessons learnt</h2>
<li><p>If you forget to save your files before you close RStudio, then RStudio will prompt you if you want to save your work.</p></li>
<li><p>Have structure in your document by using headers, text, and code chunks (maybe with comments).</p></li>
</ul>


</section>

</main>
<!-- /main column -->
</main> <!-- /main -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const toggleBodyColorMode = (bsSheetEl) => {
Expand Down Expand Up @@ -290,18 +373,7 @@ <h2 class="anchored" data-anchor-id="lessons-learnt">Lessons learnt</h2>
}
return false;
}
const clipboard = new window.ClipboardJS('.code-copy-button', {
text: function(trigger) {
const codeEl = trigger.previousElementSibling.cloneNode(true);
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
return codeEl.innerText;
}
});
clipboard.on('success', function(e) {
const onCopySuccess = function(e) {
// button target
const button = e.trigger;
// don't keep focus
Expand Down Expand Up @@ -333,15 +405,37 @@ <h2 class="anchored" data-anchor-id="lessons-learnt">Lessons learnt</h2>
}, 1000);
// clear code selection
e.clearSelection();
}
const getTextToCopy = function(trigger) {
const codeEl = trigger.previousElementSibling.cloneNode(true);
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
return codeEl.innerText;
}
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
text: getTextToCopy
});
clipboard.on('success', onCopySuccess);
if (window.document.getElementById('quarto-embedded-source-code-modal')) {
// For code content inside modals, clipBoardJS needs to be initialized with a container option
// TODO: Check when it could be a function (https://github.com/zenorocha/clipboard.js/issues/860)
const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
text: getTextToCopy,
container: window.document.getElementById('quarto-embedded-source-code-modal')
});
clipboardModal.on('success', onCopySuccess);
}
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
var mailtoRegex = new RegExp(/^mailto:/);
var filterRegex = new RegExp('/' + window.location.host + '/');
var isInternal = (href) => {
return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
}
// Inspect non-navigation links and adorn them if external
var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool)');
var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
for (var i=0; i<links.length; i++) {
const link = links[i];
if (!isInternal(link.href)) {
Expand Down
Loading

0 comments on commit 783154d

Please sign in to comment.