diff --git a/Practicals/Lina/Assignment 1/Exercise1.Rmd b/Practicals/Lina/Assignment 1/Exercise1.Rmd new file mode 100644 index 0000000..6bb9f2c --- /dev/null +++ b/Practicals/Lina/Assignment 1/Exercise1.Rmd @@ -0,0 +1,15 @@ +--- +title: "Exercise 1" +author: "Lina Kramer" +date: "1/11/2023" +output: pdf_document +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +``` + +Fun facts: + ++ I have four siblings. ++ I love Taylor Swift. \ No newline at end of file diff --git a/Practicals/Lina/Assignment 1/Exercise1.pdf b/Practicals/Lina/Assignment 1/Exercise1.pdf new file mode 100644 index 0000000..23967c3 Binary files /dev/null and b/Practicals/Lina/Assignment 1/Exercise1.pdf differ diff --git a/Practicals/Lina/Assignment 1/Exercise2.Rmd b/Practicals/Lina/Assignment 1/Exercise2.Rmd new file mode 100644 index 0000000..f478d4a --- /dev/null +++ b/Practicals/Lina/Assignment 1/Exercise2.Rmd @@ -0,0 +1,53 @@ +--- +title: "Exercise2" +author: "Lina Kramer" +date: "1/11/2023" +output: pdf_document +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +``` + +## Monte Carlo simulation + +```{r echo=TRUE, message=FALSE, warning=FALSE} +set.seed(15) +library(dplyr) +library(tidyr) +library(plotrix) + +data <- replicate (100, rnorm(200)) %>% as.data.frame()# 100 samples from a standard normal distribution n = 200 + +data <- data %>% pivot_longer(cols=everything(), names_to = "set", values_to = "val") + +sumdata <- data %>% # means, bias, standard errors, CIs + group_by(set) %>% + summarise_each(funs(mean, + bias= 0-mean, + se=sd(.)/sqrt(n()), + lower = mean - qnorm(0.975)*sd(.)/sqrt(n()), + upper= mean + qnorm(0.975)*sd(.)/sqrt(n()))) + + +sumdata + +``` +```{r echo=TRUE, warning=FALSE} +library(ggplot2) +library(gghighlight) + +pd <- position_dodge(0.78) + +ggplot(sumdata, aes(x=mean, y = set)) + + #draws the means + geom_point(position = pd) + + #draws the CI error bars + geom_errorbar(data=sumdata, aes(xmin=mean-2*se, xmax=mean+2*se), width=.1, position = pd)+ + geom_vline(xintercept = 0, color ="red") + +``` +```{r echo=TRUE} +sumdata %>% filter(lower>0 | upper <0) +``` + diff --git a/Practicals/Lina/Assignment 1/Exercise2.pdf b/Practicals/Lina/Assignment 1/Exercise2.pdf new file mode 100644 index 0000000..001d769 Binary files /dev/null and b/Practicals/Lina/Assignment 1/Exercise2.pdf differ diff --git a/Practicals/Lina/Assignment 2/Exercise2.Rmd b/Practicals/Lina/Assignment 2/Exercise2.Rmd new file mode 100644 index 0000000..411b2a4 --- /dev/null +++ b/Practicals/Lina/Assignment 2/Exercise2.Rmd @@ -0,0 +1,36 @@ +--- +title: "Exercise2" +author: "Lina Kramer" +date: "1/16/2023" +output: pdf_document +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +``` + +# Exercise + +Design a study that: + + a. Does something that requires RNG + b. Fixes the RNG seed + c. Replicates the results + d. Generates an reproducible archive/reprex/markdown + e. Will run on my machine without trouble (package installs may be excused) + f. Communicates the info of your session + +```{r echo=TRUE, warning=FALSE} +set.seed(15) + +a <- sample(1:10, size = 50, replace = TRUE) +b <- replicate(1, a) + +summary(a) +summary(b) +``` + +```{r} +sessionInfo() +``` + diff --git a/Practicals/Lina/Assignment 2/Exercise2.pdf b/Practicals/Lina/Assignment 2/Exercise2.pdf new file mode 100644 index 0000000..a016e9d Binary files /dev/null and b/Practicals/Lina/Assignment 2/Exercise2.pdf differ diff --git a/Practicals/Lina/Assignment 3/Exercise1.tex b/Practicals/Lina/Assignment 3/Exercise1.tex new file mode 100644 index 0000000..f780728 --- /dev/null +++ b/Practicals/Lina/Assignment 3/Exercise1.tex @@ -0,0 +1,110 @@ + +\documentclass[aspectratio=169]{beamer} %16:9 + + +\usetheme[]{default} +\usecolortheme{beaver} +\usepackage{tikz} +\usepackage{multirow} +\usepackage{xcolor} +\usepackage{graphicx} + +\beamertemplatenavigationsymbolsempty %suppress navigation bar +\definecolor{light-gray}{gray}{0.1} + +%TITLEPAGE +\title[Example] {Example document to recreate with \texttt{beamer} in \LaTeX} + +\author[Your Name] +{ + Lina Kramer +} + +\date[MLRPS] +{\vspace{.5 in}\\ FALL 2021 \\ Markup Languages and Reproducible Programming in Statistics \vskip6mm} + + + +\begin{document} +\titlepage + +\begin{frame} +\frametitle{Outline} +\tableofcontents +\end{frame} + +%%%%%%%%% +\section{Working with equations} +\begin{frame} +\frametitle{Working with equations} + We define a set of equations as + \begin{equation} + a=b+c^2, + \end{equation} + \begin{equation} + a-c^2=b, + \end{equation} + \begin{equation} + \text{left side} = \text{right side}, + \end{equation} + \begin{equation} + \text{left side} + \text{something} \geq \text{right side}, + \end{equation} + for all $\text{something} > 0$. +\end{frame} + +%%%%%%%%%% +\subsection{Aligning the same equations} +\begin{frame} +\frametitle{Aligning the same equations} + Aligning the equations by the equal sign gives a much better view into the placements of the separate equation components. + \begin{align} + a&=b+c^2,\\ + a-c^2&=b,\\ + \text{left side} &= \text{right side},\\ + \text{left side} + \text{something} & \geq \text{right side}, + \end{align} +\end{frame} + +%%%%%%%%%% +\subsection{Omit equation numbering} +\begin{frame} +\frametitle{Omit equation numbering} + Alternatively, the equation numbering can be omitted. + \begin{align*} + a&=b+c^2\\ + a-c^2&=b\\ + \text{left side} &= \text{right side}\\ + \text{left side} + \text{something} & \geq \text{right side} + \end{align*} +\end{frame} + +%%%%%%%%%% +\subsection{Ugly alignment} +\begin{frame} +\frametitle{Ugly alignment} +Some components do not look well, when aligned. Especially equations with different heights and spacing. For example, +\begin{align} +E&=mc^2,\\ +m&=\frac{E}{c^2},\\ +c&=\sqrt{\frac{E}{m}}. +\end{align} +Take that into account. +\end{frame} + +%%%%%%%%%% +\section{Discussion} +\begin{frame} +\frametitle{Discussion} +This is where you'd normally give your audience a recap of your talk, where you could discuss e.g. the following +\begin{itemize} +\item Your main findings +\item The consequences of your main findings +\item Things to do +\item Any other business not currently investigated, but related to your talk +\end{itemize} +\end{frame} + + +\end{document} + diff --git a/Practicals/Lina/Assignment 5/DogsofZurich.Rmd b/Practicals/Lina/Assignment 5/DogsofZurich.Rmd new file mode 100644 index 0000000..7cdf235 --- /dev/null +++ b/Practicals/Lina/Assignment 5/DogsofZurich.Rmd @@ -0,0 +1,27 @@ +--- +title: | + ![](sticker.png) + Dogs of Zurich +author: "Lina Kramer" +date: "1/16/2023" +output: beamer_presentation +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = FALSE) +``` + +```{r} +require(plotly) +require(DT) +data <- read.csv("C:/Users/linak/Downloads/20151001hundehalter.csv") +``` + +## Who are they? + +- Zurich's cutest inhabitants + + + + + diff --git a/Practicals/Lina/Assignment 5/DogsofZurich.log b/Practicals/Lina/Assignment 5/DogsofZurich.log new file mode 100644 index 0000000..f1e1060 --- /dev/null +++ b/Practicals/Lina/Assignment 5/DogsofZurich.log @@ -0,0 +1,30 @@ +This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021/W32TeX) (preloaded format=pdflatex 2022.3.23) 16 JAN 2023 16:53 +entering extended mode + restricted \write18 enabled. + %&-line parsing enabled. +**DogsofZurich.tex +(./DogsofZurich.tex +LaTeX2e <2021-11-15> patch level 1 +L3 programming layer <2022-02-24> + +! LaTeX Error: File `beamer.cls' not found. + +Type X to quit or to proceed, +or enter new name. (Default extension: cls) + +Enter file name: +! Emergency stop. + + +l.8 \usepackage + {pgfpages}^^M +Here is how much of TeX's memory you used: + 29 strings out of 480236 + 599 string characters out of 5894214 + 284331 words of memory out of 5000000 + 18082 multiletter control sequences out of 15000+600000 + 469259 words of font info for 28 fonts, out of 8000000 for 9000 + 14 hyphenation exceptions out of 8191 + 19i,0n,29p,91b,17s stack positions out of 5000i,500n,10000p,200000b,80000s + +! ==> Fatal error occurred, no output PDF file produced! diff --git a/Practicals/Lina/Assignment 5/DogsofZurich.tex b/Practicals/Lina/Assignment 5/DogsofZurich.tex new file mode 100644 index 0000000..226627f --- /dev/null +++ b/Practicals/Lina/Assignment 5/DogsofZurich.tex @@ -0,0 +1,166 @@ +% Options for packages loaded elsewhere +\PassOptionsToPackage{unicode}{hyperref} +\PassOptionsToPackage{hyphens}{url} +% +\documentclass[ + ignorenonframetext, +]{beamer} +\usepackage{pgfpages} +\setbeamertemplate{caption}[numbered] +\setbeamertemplate{caption label separator}{: } +\setbeamercolor{caption name}{fg=normal text.fg} +\beamertemplatenavigationsymbolsempty +% Prevent slide breaks in the middle of a paragraph +\widowpenalties 1 10000 +\raggedbottom +\setbeamertemplate{part page}{ + \centering + \begin{beamercolorbox}[sep=16pt,center]{part title} + \usebeamerfont{part title}\insertpart\par + \end{beamercolorbox} +} +\setbeamertemplate{section page}{ + \centering + \begin{beamercolorbox}[sep=12pt,center]{part title} + \usebeamerfont{section title}\insertsection\par + \end{beamercolorbox} +} +\setbeamertemplate{subsection page}{ + \centering + \begin{beamercolorbox}[sep=8pt,center]{part title} + \usebeamerfont{subsection title}\insertsubsection\par + \end{beamercolorbox} +} +\AtBeginPart{ + \frame{\partpage} +} +\AtBeginSection{ + \ifbibliography + \else + \frame{\sectionpage} + \fi +} +\AtBeginSubsection{ + \frame{\subsectionpage} +} +\usepackage{amsmath,amssymb} +\usepackage{lmodern} +\usepackage{iftex} +\ifPDFTeX + \usepackage[T1]{fontenc} + \usepackage[utf8]{inputenc} + \usepackage{textcomp} % provide euro and other symbols +\else % if luatex or xetex + \usepackage{unicode-math} + \defaultfontfeatures{Scale=MatchLowercase} + \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} +\fi +% Use upquote if available, for straight quotes in verbatim environments +\IfFileExists{upquote.sty}{\usepackage{upquote}}{} +\IfFileExists{microtype.sty}{% use microtype if available + \usepackage[]{microtype} + \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts +}{} +\makeatletter +\@ifundefined{KOMAClassName}{% if non-KOMA class + \IfFileExists{parskip.sty}{% + \usepackage{parskip} + }{% else + \setlength{\parindent}{0pt} + \setlength{\parskip}{6pt plus 2pt minus 1pt}} +}{% if KOMA class + \KOMAoptions{parskip=half}} +\makeatother +\usepackage{xcolor} +\newif\ifbibliography +\usepackage{graphicx} +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} +\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} +\makeatother +% Scale images if necessary, so that they will not overflow the page +% margins by default, and it is still possible to overwrite the defaults +% using explicit options in \includegraphics[width, height, ...]{} +\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} +% Set default figure placement to htbp +\makeatletter +\def\fps@figure{htbp} +\makeatother +\setlength{\emergencystretch}{3em} % prevent overfull lines +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} +\setcounter{secnumdepth}{-\maxdimen} % remove section numbering +\ifLuaTeX + \usepackage{selnolig} % disable illegal ligatures +\fi +\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} +\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available +\urlstyle{same} % disable monospaced font for URLs +\hypersetup{ + pdftitle={ Dogs of Zurich}, + pdfauthor={Lina Kramer}, + hidelinks, + pdfcreator={LaTeX via pandoc}} + +\title{\includegraphics{sticker.png} Dogs of Zurich} +\author{Lina Kramer} +\date{1/16/2023} + +\begin{document} +\frame{\titlepage} + +\begin{frame}[fragile] +\begin{verbatim} +## Loading required package: plotly +\end{verbatim} + +\begin{verbatim} +## Warning: package 'plotly' was built under R version 4.1.3 +\end{verbatim} + +\begin{verbatim} +## Loading required package: ggplot2 +\end{verbatim} + +\begin{verbatim} +## Warning: package 'ggplot2' was built under R version 4.1.3 +\end{verbatim} + +\begin{verbatim} +## +## Attaching package: 'plotly' +\end{verbatim} + +\begin{verbatim} +## The following object is masked from 'package:ggplot2': +## +## last_plot +\end{verbatim} + +\begin{verbatim} +## The following object is masked from 'package:stats': +## +## filter +\end{verbatim} + +\begin{verbatim} +## The following object is masked from 'package:graphics': +## +## layout +\end{verbatim} + +\begin{verbatim} +## Loading required package: DT +\end{verbatim} +\end{frame} + +\begin{frame}{Who are they?} +\protect\hypertarget{who-are-they}{} +\begin{itemize} +\tightlist +\item + Zurich's cutest inhabitants +\end{itemize} +\end{frame} + +\end{document} diff --git a/Practicals/Lina/Assignment 5/Exercise_Presentation-figure/unnamed-chunk-2-1.png b/Practicals/Lina/Assignment 5/Exercise_Presentation-figure/unnamed-chunk-2-1.png new file mode 100644 index 0000000..a81119c Binary files /dev/null and b/Practicals/Lina/Assignment 5/Exercise_Presentation-figure/unnamed-chunk-2-1.png differ diff --git a/Practicals/Lina/Assignment 5/Exercise_Presentation.Rpres b/Practicals/Lina/Assignment 5/Exercise_Presentation.Rpres new file mode 100644 index 0000000..93e7856 --- /dev/null +++ b/Practicals/Lina/Assignment 5/Exercise_Presentation.Rpres @@ -0,0 +1,28 @@ +Exercise_Presentation +======================================================== +author: +date: +autosize: true + +First Slide +======================================================== + +For more details on authoring R presentations please visit . + +- Bullet 1 +- Bullet 2 +- Bullet 3 + +Slide With Code +======================================================== + +```{r} +summary(cars) +``` + +Slide With Plot +======================================================== + +```{r, echo=FALSE} +plot(cars) +``` diff --git a/Practicals/Lina/Assignment 5/Exercise_Presentation.md b/Practicals/Lina/Assignment 5/Exercise_Presentation.md new file mode 100644 index 0000000..132f2fa --- /dev/null +++ b/Practicals/Lina/Assignment 5/Exercise_Presentation.md @@ -0,0 +1,37 @@ +Exercise_Presentation +======================================================== +author: +date: +autosize: true + +First Slide +======================================================== + +For more details on authoring R presentations please visit . + +- Bullet 1 +- Bullet 2 +- Bullet 3 + +Slide With Code +======================================================== + + +```r +summary(cars) +``` + +``` + speed dist + Min. : 4.0 Min. : 2.00 + 1st Qu.:12.0 1st Qu.: 26.00 + Median :15.0 Median : 36.00 + Mean :15.4 Mean : 42.98 + 3rd Qu.:19.0 3rd Qu.: 56.00 + Max. :25.0 Max. :120.00 +``` + +Slide With Plot +======================================================== + +![plot of chunk unnamed-chunk-2](Exercise_Presentation-figure/unnamed-chunk-2-1.png)