Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
Auto-generated via `{sandpaper}`
Source  : 6fc2cb9
Branch  : main
Author  : Christian Knudsen <[email protected]>
Time    : 2024-11-08 13:40:54 +0000
Message : Merge pull request #171 from chrbknudsen/main

primært chunk-naming
  • Loading branch information
actions-user committed Nov 8, 2024
1 parent 051011d commit ec19da2
Show file tree
Hide file tree
Showing 10 changed files with 158 additions and 32 deletions.
4 changes: 2 additions & 2 deletions clt.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mean(random_numbers)
```

``` output
[1] 0.5095871
[1] 0.4877989
```
The important point of the Central Limit Theorem is, that if we take a large
number of random samples, and calculate the mean of each of these samples,
Expand All @@ -59,7 +59,7 @@ mean(runif(100))
```

``` output
[1] 0.4959613
[1] 0.4897284
```
And we can use the `replicate()` function to repeat that calculation several times, in this case 1000 times:

Expand Down
Binary file modified fig/clt-rendered-random-histogram-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/clt-rendered-repeated-means-histogram-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This site is a collection of individual episodes. It is not intended
as a single course. The concept is for this site to act as the foundation for made-to-measure courses.
Based on the individual and specific needs in a given situation, we will make a
selection of relevant episodes, and string them together to form a tailored
course,.
course.

The episodes are under construction, and will continue to be, as we will
add new content until we have covered any subject that might arise working with
Expand Down
38 changes: 19 additions & 19 deletions kmeans.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,31 +144,31 @@ clustering
```

``` output
K-means clustering with 3 clusters of sizes 62, 69, 47
K-means clustering with 3 clusters of sizes 69, 47, 62
Cluster means:
Alcohol Malicacid Ash Alcalinityofash Magnesium Totalphenols Flavanoids
1 12.92984 2.504032 2.408065 19.89032 103.59677 2.111129 1.584032
2 12.51667 2.494203 2.288551 20.82319 92.34783 2.070725 1.758406
3 13.80447 1.883404 2.426170 17.02340 105.51064 2.867234 3.014255
1 12.51667 2.494203 2.288551 20.82319 92.34783 2.070725 1.758406
2 13.80447 1.883404 2.426170 17.02340 105.51064 2.867234 3.014255
3 12.92984 2.504032 2.408065 19.89032 103.59677 2.111129 1.584032
Nonflavanoidphenols Proanthocyanins Colorintensity Hue
1 0.3883871 1.503387 5.650323 0.8839677
2 0.3901449 1.451884 4.086957 0.9411594
3 0.2853191 1.910426 5.702553 1.0782979
1 0.3901449 1.451884 4.086957 0.9411594
2 0.2853191 1.910426 5.702553 1.0782979
3 0.3883871 1.503387 5.650323 0.8839677
OD280OD315ofdilutedwines Proline
1 2.365484 728.3387
2 2.490725 458.2319
3 3.114043 1195.1489
1 2.490725 458.2319
2 3.114043 1195.1489
3 2.365484 728.3387
Clustering vector:
[1] 3 3 3 3 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 3 3 1 1 3 3 1 3 3 3 3 3 3 1 1
[38] 3 3 1 1 3 3 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 1 2 1 2 2 1 2 2 1 1 1 2 2 3
[75] 1 2 2 2 1 2 2 1 1 2 2 2 2 2 1 1 2 2 2 2 2 1 1 2 1 2 1 2 2 2 1 2 2 2 2 1 2
[112] 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 1 1 1 1 2 2 2 1 1 2 2 1 1 2 1
[149] 1 2 2 2 2 1 1 1 2 1 1 1 2 1 2 1 1 2 1 1 1 1 2 2 1 1 1 1 1 2
[1] 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 2 2 3 3 2 2 3 2 2 2 2 2 2 3 3
[38] 2 2 3 3 2 2 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 1 3 1 1 3 1 1 3 3 3 1 1 2
[75] 3 1 1 1 3 1 1 3 3 1 1 1 1 1 3 3 1 1 1 1 1 3 3 1 3 1 3 1 1 1 3 1 1 1 1 3 1
[112] 1 3 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 3 1 1 3 3 3 3 1 1 1 3 3 1 1 3 3 1 3
[149] 3 1 1 1 1 3 3 3 1 3 3 3 1 3 1 3 3 1 3 3 3 3 1 1 3 3 3 3 3 1
Within cluster sum of squares by cluster:
[1] 566572.5 443166.7 1360950.5
[1] 443166.7 1360950.5 566572.5
(between_SS / total_SS = 86.5 %)
Available components:
Expand All @@ -188,9 +188,9 @@ table()
``` output
true
quess 1 2 3
1 13 20 29
2 0 50 19
3 46 1 0
1 0 50 19
2 46 1 0
3 13 20 29
```

The algorithm have no idea about the numbering, the three groups are numbered
Expand Down
8 changes: 4 additions & 4 deletions md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2024-11-08"
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2024-11-08"
"config.yaml" "76188894d250a68fbdf65206cee2d873" "site/built/config.yaml" "2024-11-08"
"index.md" "e4e80431f54f0c27189828975817535f" "site/built/index.md" "2024-11-08"
"index.md" "61394b6d8242b2ec5c69d9c2493cd74b" "site/built/index.md" "2024-11-08"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2024-11-08"
"episodes/reproducible-analysis.Rmd" "c35d8069a53be38e0fc226243af7fc12" "site/built/reproducible-analysis.md" "2024-11-08"
"episodes/reading-files.Rmd" "f16cdf18bbcf52659587b4f4b0985461" "site/built/reading-files.md" "2024-11-08"
"episodes/reproducible-analysis.Rmd" "976433176d38ef5f97b18f2b25794941" "site/built/reproducible-analysis.md" "2024-11-08"
"episodes/reading-files.Rmd" "16728c259f424282058f7c80997900d2" "site/built/reading-files.md" "2024-11-08"
"episodes/descript-stat.Rmd" "828abde6deb35bebf2b60f730d6eaff7" "site/built/descript-stat.md" "2024-11-08"
"episodes/table1.Rmd" "1615b0b67bb2e6a3d9a992a00d3edde3" "site/built/table1.md" "2024-11-08"
"episodes/tidy-data.Rmd" "32109e710bb7b47451b8783b246aa857" "site/built/tidy-data.md" "2024-11-08"
Expand All @@ -30,7 +30,7 @@
"learners/CLT-en.md" "8ae8f14f05472820ef155acf980ae06f" "site/built/CLT-en.md" "2024-11-08"
"learners/data.md" "629a1935166e040d5aa8832446946310" "site/built/data.md" "2024-11-08"
"learners/reference.md" "527a12e217602daae51c5fd9ef8958df" "site/built/reference.md" "2024-11-08"
"learners/setup.md" "0c80507a6a78380e67338e8e60563b20" "site/built/setup.md" "2024-11-08"
"learners/setup.md" "9b1b924cf88e06b154562a92250fcb76" "site/built/setup.md" "2024-11-08"
"poster/poster_dk.Rmd" "721a2b68eeb0b61308158bce41c6ae21" "site/built/poster_dk.md" "2024-11-08"
"profiles/learner-profiles.md" "5fe5bf7537072422b91ed393ada03f9a" "site/built/learner-profiles.md" "2024-11-08"
"renv/profiles/lesson-requirements/renv.lock" "18fc1cfeec6bf26f24f2759c070cc46a" "site/built/renv.lock" "2024-11-08"
2 changes: 1 addition & 1 deletion normal-distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ rnorm(5, mean = 0, sd = 1 )
```

``` output
[1] -0.49124146 -0.04092335 0.55254473 1.66132290 -0.01081915
[1] -0.3687852 0.2342679 1.4054515 2.5355764 0.4683077
```
Den returnerer (her) fem tilfældige værdier fra en normalfordeling med (her)
middelværdi 0 og standardafvigelse 1.
Expand Down
2 changes: 1 addition & 1 deletion reading-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ editor_options:
---

::: questions
- How do you read in data from files??
- How do you read in data from files?
:::

::: objectives
Expand Down
8 changes: 5 additions & 3 deletions reproducible-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ is not working. Doing the same analysis tomorrow, we should reach the same resul
And that can be surprisingly difficult!

There are a lot of pitfalls, ranging from accessibility to incentive structures
in academia. But the two areas where R can help us are:
in academia. But the three areas where R can help us are:

* Software Environment
* Documentation and Metadata
Expand Down Expand Up @@ -82,7 +82,7 @@ computer crashes.



## Documentation and Metadata:
## Documentation and Metadata

What did we actually do in the analysis? Why did we do it? Why are we reaching the conclusion we've arrived at?

Expand Down Expand Up @@ -166,7 +166,9 @@ data set.

Make a new RMarkdown document - File -> New File -> R Markdown.

Change the final code chunk to include `plot(cars$dist)` instead of plot(pressure)
Change the final code chunk to include `plot(cars$dist)` instead of plot(pressure),
and add `library(tidyverse)`.


::::

Expand Down
126 changes: 125 additions & 1 deletion setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,130 @@
title: Setup
---

## Setup
## Software Setup

::::::::::::::::::::::::: callout

### Warning

Please do NOT install R and RStudio on Onedrive or other clouddrives.
R will work but you will not be able to install the extensions to R
that you will need in this course!

::::::::::::

::::::::::::::::::::::::::::::::::::::: discussion

### Installing R and RStudio

**R** and **RStudio** are separate downloads and installations. R is the
underlying statistical computing environment, but using R alone is no
fun. RStudio is a graphical integrated development environment (IDE) that makes
using R much easier and more interactive. You need to install R before you
install RStudio. Once installed, because RStudio is an IDE, RStudio will run R in
the background. You do not need to run it separately.



:::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::: solution

### Online
Rather than installing R and RStudio on your personal computer,
[Posit Cloud](https://posit.cloud//) offers a free, online alternative,
where you will be able to run R and RStudio in your browser.
Sign up with your Google/Gmail account if you have one, or with any other email.

The free version of RStudio Cloud places limitations on the number of projects you
can work on, and the amount of memory and processing power you can access. For the
purposes of following these lessons, RStudio Cloud is perfectly adequate, and what we
recommend if you have any problems installing R and RStudio on your personal computer.

:::::::::::::::::::::::::

:::::::::::::::: solution

### Windows

#### If you already have R and RStudio installed

* Open RStudio, and click on "Help" > "Check for updates". If a new version is
available, quit RStudio, and download the latest version for RStudio.
* To check which version of R you are using, start RStudio and the first thing
that appears in the console indicates the version of R you are
running. Alternatively, you can type `sessionInfo()`, which will also display
which version of R you are running. Go on
the [CRAN website](https://cran.r-project.org/bin/windows/base/) and check
whether a more recent version is available. If so, please download and install
it. You can [check here](https://cran.r-project.org/bin/windows/base/rw-FAQ.html#How-do-I-UNinstall-R_003f) for
more information on how to remove old versions from your system if you wish to do so.

#### If you don't have R and RStudio installed

* Download R from
the [CRAN website](https://cran.r-project.org/bin/windows/base/release.htm).
* Run the `.exe` file that was just downloaded.
* Go to the [RStudio download page](https://www.rstudio.com/products/rstudio/download/#download).
* Under *Installers* select **RStudio x.yy.zzz - Windows.
Vista/7/8/10** (where x, y, and z represent version numbers).
* Double click the file to install it.
* Once it's installed, open RStudio to make sure it works and you don't get any
error messages.

:::::::::::::::::::::::::

:::::::::::::::: solution

### MacOS

#### If you already have R and RStudio installed

* Open RStudio, and click on "Help" > "Check for updates". If a new version is
available, quit RStudio, and download the latest version for RStudio.
* To check the version of R you are using, start RStudio and the first thing
that appears on the terminal indicates the version of R you are running. Alternatively, you can type `sessionInfo()`, which will also display which version of R you are running. Go on
the [CRAN website](https://cran.r-project.org/bin/macosx/) and check
whether a more recent version is available. If so, please download and install
it. In any case, make sure you have at least R 3.2.

#### If you don't have R and RStudio installed

* Download R from
the [CRAN website](https://cran.r-project.org/bin/macosx/).
* Select the `.pkg` file for the latest R version.
* Double click on the downloaded file to install R.
* It is also a good idea to install [XQuartz](https://www.xquartz.org/) (needed
by some packages).
* Go to the [RStudio download page](https://www.rstudio.com/products/rstudio/download/#download).
* Under *Installers* select **RStudio x.yy.zzz - Mac OS X 10.6+ (64-bit)**
(where x, y, and z represent version numbers).
* Double click the file to install RStudio.
* Once it's installed, open RStudio to make sure it works and you don't get any
error messages.

:::::::::::::::::::::::::


:::::::::::::::: solution

### Linux

* Follow the instructions for your distribution
from [CRAN](https://cloud.r-project.org/bin/linux), they provide information
to get the most recent version of R for common distributions. For most
distributions, you could use your package manager (e.g., for Debian/Ubuntu run
`sudo apt-get install r-base`, and for Fedora `sudo yum install R`), but we
don't recommend this approach as the versions provided by this approach are
usually out of date. In any case, make sure you have at least R 3.2.
* Go to the
[RStudio download page](https://www.rstudio.com/products/rstudio/download/#download).
* Under *Installers* select the version that matches your distribution, and
install it with your preferred method (e.g., with Debian/Ubuntu `sudo dpkg -i
rstudio-x.yy.zzz-amd64.deb` at the terminal).
* Once it's installed, open RStudio to make sure it works and you don't get any
error messages.

:::::::::::::::::::::::::


0 comments on commit ec19da2

Please sign in to comment.