Compare commits
3 Commits
5cdb5fdb8f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a2df1d6f4 | |||
| 7a2327aba3 | |||
| 66c9711d45 |
@@ -279,7 +279,7 @@ Date & Topic \\
|
|||||||
\end{itemize}
|
\end{itemize}
|
||||||
\vfill
|
\vfill
|
||||||
\pause
|
\pause
|
||||||
(Maybe check out the two tips of the week on this topic:
|
(Maybe check out the three tips of the week on this topic:
|
||||||
{\tiny
|
{\tiny
|
||||||
\url{https://iwmonline.sharepoint.com/sites/intranet/SitePages/direktorat/en/Interne-Kommunikation.aspx\#tip-of-the-week-tutorial-series}})
|
\url{https://iwmonline.sharepoint.com/sites/intranet/SitePages/direktorat/en/Interne-Kommunikation.aspx\#tip-of-the-week-tutorial-series}})
|
||||||
\end{frame}
|
\end{frame}
|
||||||
@@ -407,7 +407,41 @@ Date & Topic \\
|
|||||||
|
|
||||||
\section[Repositories]{Sharing data in repositories}
|
\section[Repositories]{Sharing data in repositories}
|
||||||
|
|
||||||
\begin{frame}{Data repositories}
|
\begin{frame}[allowframebreaks]{Data publication}
|
||||||
|
Which data should I share?
|
||||||
|
\begin{itemize}
|
||||||
|
\item In general, all data that are used in publications
|
||||||
|
\item Data for your dissertation
|
||||||
|
\item Data that you collected but know that you will never come around to
|
||||||
|
analyzing
|
||||||
|
\end{itemize}
|
||||||
|
\vspace{.3cm}
|
||||||
|
What are the reasons to share data?
|
||||||
|
\begin{itemize}
|
||||||
|
\item Transparency
|
||||||
|
\item Data safety
|
||||||
|
\item Cumulative research process
|
||||||
|
\item Visibility
|
||||||
|
\end{itemize}
|
||||||
|
\framebreak
|
||||||
|
For whom are you sharing data?
|
||||||
|
\begin{itemize}
|
||||||
|
\item Yourself
|
||||||
|
\item Reviewers
|
||||||
|
\item People who read your papers
|
||||||
|
\item Other scientists
|
||||||
|
\item Colleagues and collaboraters
|
||||||
|
\end{itemize}
|
||||||
|
\vspace{.3cm}
|
||||||
|
How should you share your data?
|
||||||
|
\begin{itemize}
|
||||||
|
\item On a public platform (or website), i.\,e., no account needed if
|
||||||
|
possible
|
||||||
|
\item Together with a codebook or at least an informative README
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Data repositories (suggested in our Research Data Policy)}
|
||||||
National
|
National
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item \url{https://www.psycharchives.org/}
|
\item \url{https://www.psycharchives.org/}
|
||||||
@@ -427,6 +461,48 @@ Date & Topic \\
|
|||||||
\hfill{\footnotesize \url{https://datamanagement.hms.harvard.edu/share-publish/data-repositories}}
|
\hfill{\footnotesize \url{https://datamanagement.hms.harvard.edu/share-publish/data-repositories}}
|
||||||
\end{frame}
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[<+->]{Zenodo}{https://zenodo.org/}
|
||||||
|
\begin{itemize}
|
||||||
|
\item General-purpose open repository launched in 2015
|
||||||
|
\item Financed by the EU (European OpenAIRE program)
|
||||||
|
\item Operated by CERN
|
||||||
|
\item All disciplines
|
||||||
|
\item Suitable for
|
||||||
|
\begin{itemize}
|
||||||
|
\item Data sets
|
||||||
|
\item Papers / Preprints
|
||||||
|
\item Research software
|
||||||
|
\item Reports
|
||||||
|
\item Any other digital research objects
|
||||||
|
\end{itemize}
|
||||||
|
\item Upload up to 50 GB possible
|
||||||
|
\item Easily citable since all objects get DOI
|
||||||
|
\item Open source code is available on Github
|
||||||
|
\item IWM example: \url{https://doi.org/10.5281/zenodo.2532411}
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[<+->]{PsychArchives}{https://psycharchives.org/}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Disciplinary repository for psychological science (and neighboring
|
||||||
|
disciplines)
|
||||||
|
\item Developed and operated by ZPID (Leibniz-Institut für Psycholgie)
|
||||||
|
\item Accommodating 20 different digital research object (DRO) types
|
||||||
|
\begin{itemize}
|
||||||
|
\item Articles
|
||||||
|
\item Preprints
|
||||||
|
\item Research data
|
||||||
|
\item Code
|
||||||
|
\item Supplements
|
||||||
|
\item Preregistrations
|
||||||
|
\item \dots
|
||||||
|
\end{itemize}
|
||||||
|
\item Searchable by ``IWM'': \url{https://psycharchives.org/en/browse/?q=iwm}
|
||||||
|
\item Easily citable since all objects get DOI
|
||||||
|
\item Different objects can be linked together (e.\,g., data und code)
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
\appendix
|
\appendix
|
||||||
%%\begin{frame}[allowframebreaks]{References}
|
%%\begin{frame}[allowframebreaks]{References}
|
||||||
\begin{frame}{References}
|
\begin{frame}{References}
|
||||||
@@ -435,26 +511,5 @@ Date & Topic \\
|
|||||||
\vfill
|
\vfill
|
||||||
\end{frame}
|
\end{frame}
|
||||||
|
|
||||||
\begin{frame}{A codebook should include}
|
|
||||||
\begin{tabular}{lp{11cm}}
|
|
||||||
\hline
|
|
||||||
Variable name & Usually some abbreviation like \texttt{pna01} \\
|
|
||||||
Variable label & Brief description to identify variable \\
|
|
||||||
Question text & If applicable, exact wording from survey question \\
|
|
||||||
Values & Values variable can take (e.\,g, 1 to 5) \\
|
|
||||||
Value labels & If applicable, textual descriptions of the values \\
|
|
||||||
Statistics & For example, range, mean, standard deviation for
|
|
||||||
numeric variables; frequencies and percentages for categorical variables \\
|
|
||||||
Missing data & If applicable, values and labels of missing data \\
|
|
||||||
Notes & Additional notes, remarks, or comments; for measures or
|
|
||||||
questions from copyrighted instruments, the notes field can be used to
|
|
||||||
cite the source \\
|
|
||||||
\hline
|
|
||||||
\end{tabular}
|
|
||||||
\vfill
|
|
||||||
|
|
||||||
\hfill\tiny \url{https://www.icpsr.umich.edu/web/ICPSR/cms/1983}
|
|
||||||
\end{frame}
|
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,503 @@
|
|||||||
|
\documentclass[aspectratio=169]{beamer}
|
||||||
|
|
||||||
|
\usepackage{listings}
|
||||||
|
%\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage[style = apa, backend = biber, natbib = true]{biblatex}
|
||||||
|
\addbibresource{../literature/lit.bib}
|
||||||
|
|
||||||
|
\usepackage{fancyvrb}
|
||||||
|
\usepackage{fontawesome5} % get icons
|
||||||
|
\usepackage{multirow}
|
||||||
|
\usepackage{color, colortbl}
|
||||||
|
|
||||||
|
\usepackage{tikz}
|
||||||
|
\usetikzlibrary{fit}
|
||||||
|
\usepackage[edges]{forest}
|
||||||
|
|
||||||
|
\lstset{language = R,%
|
||||||
|
basicstyle = \ttfamily\color{iwmgray},
|
||||||
|
frame = single,
|
||||||
|
rulecolor = \color{iwmgray},
|
||||||
|
commentstyle = \slshape\color{iwmgreen},
|
||||||
|
keywordstyle = \bfseries\color{iwmgray},
|
||||||
|
identifierstyle = \color{iwmpurple},
|
||||||
|
stringstyle = \color{iwmblue},
|
||||||
|
numbers = none,%left,numberstyle = \tiny,
|
||||||
|
basewidth = {.5em, .4em},
|
||||||
|
showstringspaces = false,
|
||||||
|
emphstyle = \color{red!50!white}}
|
||||||
|
|
||||||
|
\makeatletter \def\newblock{\beamer@newblock} \makeatother
|
||||||
|
|
||||||
|
\beamertemplatenavigationsymbolsempty
|
||||||
|
\setbeamertemplate{itemize items}[circle]
|
||||||
|
\setbeamertemplate{section in toc}[circle]
|
||||||
|
\mode<beamer>{\setbeamercolor{math text displayed}{fg=iwmgray}}
|
||||||
|
\setbeamercolor{block body}{bg=iwmorange!50!white}
|
||||||
|
\setbeamercolor{block title}{fg=white, bg=iwmorange}
|
||||||
|
% Definitions for biblatex
|
||||||
|
\setbeamercolor{bibliography entry note}{fg=iwmgray}
|
||||||
|
\setbeamercolor{bibliography entry author}{fg=iwmgray}
|
||||||
|
\setbeamertemplate{bibliography item}{}
|
||||||
|
|
||||||
|
\definecolor{iwmorange}{RGB}{255,105,0}
|
||||||
|
\definecolor{iwmgray}{RGB}{67,79,79}
|
||||||
|
\definecolor{iwmblue}{RGB}{60,180,220}
|
||||||
|
\definecolor{iwmgreen}{RGB}{145,200,110}
|
||||||
|
\definecolor{iwmpurple}{RGB}{120,0,75}
|
||||||
|
|
||||||
|
\setbeamercolor{title}{fg=iwmorange}
|
||||||
|
\setbeamercolor{frametitle}{fg=iwmorange}
|
||||||
|
\setbeamercolor{structure}{fg=iwmorange}
|
||||||
|
\setbeamercolor{normal text}{fg=iwmgray}
|
||||||
|
\setbeamercolor{author}{fg=iwmgray}
|
||||||
|
\setbeamercolor{date}{fg=iwmgray}
|
||||||
|
|
||||||
|
\newcommand{\vect}[1]{\mathbf{#1}}
|
||||||
|
\newcommand{\mat}[1]{\mathbf{#1}}
|
||||||
|
\newcommand{\gvect}[1]{\boldsymbol{#1}}
|
||||||
|
\newcommand{\gmat}[1]{\boldsymbol{#1}}
|
||||||
|
|
||||||
|
\AtBeginSection[]{
|
||||||
|
\frame{
|
||||||
|
\tableofcontents[sectionstyle=show/hide, subsectionstyle=show/show/hide]}}
|
||||||
|
|
||||||
|
\setbeamertemplate{headline}{
|
||||||
|
\begin{beamercolorbox}{section in head}
|
||||||
|
\vskip5pt\insertsectionnavigationhorizontal{\paperwidth}{}{}\vskip2pt
|
||||||
|
\end{beamercolorbox}
|
||||||
|
}
|
||||||
|
|
||||||
|
\setbeamertemplate{footline}{\vskip-2pt\hfill\insertframenumber$\;$\vskip2pt}
|
||||||
|
|
||||||
|
\title{Clean coding}
|
||||||
|
\author{Nora Wickelmaier}
|
||||||
|
\date{July 8, 2024}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\begin{frame}{}
|
||||||
|
\thispagestyle{empty}
|
||||||
|
\titlepage
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{What is needed to make code reproducible?}
|
||||||
|
% slido
|
||||||
|
\centering
|
||||||
|
\includegraphics[width = 5cm]{../figures/QR Code for Methodenseminar SS 2024 - Session 5}
|
||||||
|
|
||||||
|
\url{https://app.sli.do/event/uEz8fJWkLBNm1sthQovXNH}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Programming resources}
|
||||||
|
\footnotesize
|
||||||
|
\begin{tabular}{ll}
|
||||||
|
Learning statistics with R & {\url{https://learningstatisticswithr.com/book/}} \\
|
||||||
|
&\\
|
||||||
|
R for Data Science & {\url{https://r4ds.hadley.nz/}} \\
|
||||||
|
&\\
|
||||||
|
Advanced R & {\url{https://adv-r.hadley.nz/}} \\
|
||||||
|
&\\
|
||||||
|
Happy Git and GitHub for the useR & {\url{https://happygitwithr.com/}} \\
|
||||||
|
&\\
|
||||||
|
R Programming for Research & {\url{https://geanders.github.io/RProgrammingForResearch/}} \\
|
||||||
|
&\\
|
||||||
|
Building reproducible analytical pipelines with R & {\url{https://raps-with-r.dev/}} \\
|
||||||
|
&\\
|
||||||
|
Data Skills for Reproducible Science & {\url{https://psyteachr.github.io/msc-data-skills/}} \\
|
||||||
|
\end{tabular}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Agenda}
|
||||||
|
\centering
|
||||||
|
\begin{tabular}{ll}
|
||||||
|
\hline
|
||||||
|
Date & Topic \\
|
||||||
|
\hline
|
||||||
|
2024-05-13 & Introduction to data management \\
|
||||||
|
2024-05-27 & Workflow \\
|
||||||
|
2024-06-10 & Data organisation\\
|
||||||
|
2024-06-24 & Data sharing \\
|
||||||
|
\only<1>{2024-07-08}\only<2>{\bf 2024-07-08} &
|
||||||
|
\only<1>{Clean coding}\only<2>{\bf Clean coding} \\
|
||||||
|
2024-07-22 & Version control \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
% Understandable coding
|
||||||
|
% Cleaning up R code for readability
|
||||||
|
% Documentation of a final R script
|
||||||
|
% Reproducible code
|
||||||
|
|
||||||
|
\section{Style guidelines}
|
||||||
|
|
||||||
|
\begin{frame}[<+->]{Style guidelines in R}
|
||||||
|
\begin{itemize}
|
||||||
|
\item R has no mandatory or commonly accepted style guide
|
||||||
|
\item However, Hadley Wickham and Google developed style guides which are
|
||||||
|
now widely accepted
|
||||||
|
\begin{itemize}
|
||||||
|
\item \url{https://google.github.io/styleguide/Rguide.html}
|
||||||
|
\item \url{https://style.tidyverse.org/}
|
||||||
|
\end{itemize}
|
||||||
|
\item It is always a good idea to follow a style guide and not ``create''
|
||||||
|
your own rules (if you deviate, be consistent!)
|
||||||
|
\item A style guide helps with
|
||||||
|
\begin{itemize}
|
||||||
|
\item Keeping code clean which is easier to read and interpret
|
||||||
|
\item Making it easier to catch and fix mistakes
|
||||||
|
\item Making it easier for others to follow and adapt your code
|
||||||
|
\item Preventing possible problems, e.\,g., avoiding dots in function
|
||||||
|
names
|
||||||
|
\end{itemize}
|
||||||
|
\end{itemize}
|
||||||
|
\nocite{Wickham_styleguide, Anderson2023}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile, allowframebreaks]{File names}
|
||||||
|
\begin{itemize}
|
||||||
|
\item File names should be meaningful and end in .R
|
||||||
|
\item Avoid using special characters in file names
|
||||||
|
\item Stick with numbers, letters, \verb+-+, and \verb+_+
|
||||||
|
\begin{lstlisting}[identifierstyle = \bfseries\color{iwmgray}]
|
||||||
|
# Good
|
||||||
|
fit_models.R
|
||||||
|
utility_functions.R
|
||||||
|
|
||||||
|
# Bad
|
||||||
|
fit models.R
|
||||||
|
foo.r
|
||||||
|
stuff.r
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item If files should be run in a particular order, prefix them with numbers
|
||||||
|
\item If it seems likely you’ll have more than 10 files, left pad with zero
|
||||||
|
\begin{lstlisting}[identifierstyle = \bfseries\color{iwmgray}]
|
||||||
|
00_download.R
|
||||||
|
01_explore.R
|
||||||
|
...
|
||||||
|
09_model.R
|
||||||
|
10_visualize.R
|
||||||
|
\end{lstlisting}
|
||||||
|
\item If you later realize that you missed some steps, it’s tempting to use
|
||||||
|
02a, 02b, etc.
|
||||||
|
\item However, it is generally better to bite the bullet and rename all
|
||||||
|
files
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile, allowframebreaks]{Object names}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Variable and function names should use only lowercase letters,
|
||||||
|
numbers, and \verb+_+
|
||||||
|
\item Use underscores (\verb+_+) (so called snake case) to separate words
|
||||||
|
within a name
|
||||||
|
\begin{lstlisting}[identifierstyle = \bfseries\color{iwmgray}]
|
||||||
|
# Good
|
||||||
|
day_one
|
||||||
|
day_1
|
||||||
|
|
||||||
|
# Bad
|
||||||
|
DayOne
|
||||||
|
dayone
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item Generally, variable names should be nouns and function names should be
|
||||||
|
verbs
|
||||||
|
\item Strive for names that are concise and meaningful
|
||||||
|
\begin{lstlisting}[identifierstyle = \bfseries\color{iwmgray}]
|
||||||
|
# Good
|
||||||
|
day_one
|
||||||
|
|
||||||
|
# Bad
|
||||||
|
first_day_of_the_month
|
||||||
|
djm1
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item Avoid re-using names of common functions and variables
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Bad
|
||||||
|
T <- FALSE
|
||||||
|
c <- 10
|
||||||
|
mean <- function(x) sum(x)
|
||||||
|
\end{lstlisting}
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile, allowframebreaks]{Spacing}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Always put a space after a comma, never before
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Good
|
||||||
|
x[, 1]
|
||||||
|
|
||||||
|
# Bad
|
||||||
|
x[,1]
|
||||||
|
x[ ,1]
|
||||||
|
x[ , 1]
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item Do not put spaces inside or outside parentheses for regular function
|
||||||
|
calls
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Good
|
||||||
|
mean(x, na.rm = TRUE)
|
||||||
|
|
||||||
|
# Bad
|
||||||
|
mean (x, na.rm = TRUE)
|
||||||
|
mean( x, na.rm = TRUE )
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item Place a space before and after \texttt{()} when used with \texttt{if},
|
||||||
|
\texttt{for}, or \texttt{while}
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Good
|
||||||
|
if (debug) {
|
||||||
|
show(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Bad
|
||||||
|
if(debug){
|
||||||
|
show(x)
|
||||||
|
}
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item Place a space after \texttt{()} used for function arguments
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Good
|
||||||
|
function(x) {}
|
||||||
|
|
||||||
|
# Bad
|
||||||
|
function (x) {}
|
||||||
|
function(x){}
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item Most infix operators (\verb+==+, \verb|+|, \verb+-+, \verb+<-+, etc.)
|
||||||
|
should always be surrounded by spaces
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Good
|
||||||
|
height <- (feet * 12) + inches
|
||||||
|
mean(x, na.rm = TRUE)
|
||||||
|
|
||||||
|
# Bad
|
||||||
|
height<-feet*12+inches
|
||||||
|
mean(x, na.rm=TRUE)
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item There are a few exceptions, which should never be surrounded by
|
||||||
|
spaces: \verb+::+, \verb+:::+, \verb+$+, \verb+@+, \verb+[+, \verb+[[+,
|
||||||
|
\verb+?+, \verb+^+, and \verb+:+
|
||||||
|
{\small
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Good
|
||||||
|
sqrt(x^2 + y^2)
|
||||||
|
df$z
|
||||||
|
x <- 1:10
|
||||||
|
package?stats
|
||||||
|
?mean
|
||||||
|
|
||||||
|
# Bad
|
||||||
|
sqrt(x ^ 2 + y ^ 2)
|
||||||
|
df $ z
|
||||||
|
x <- 1 : 10
|
||||||
|
package ? stats
|
||||||
|
? mean
|
||||||
|
\end{lstlisting}
|
||||||
|
}
|
||||||
|
\item Adding extra spaces is ok if it improves alignment of \verb+=+ or
|
||||||
|
\verb+<-+
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Good
|
||||||
|
list(
|
||||||
|
total = a + b + c,
|
||||||
|
mean = (a + b + c) / n
|
||||||
|
)
|
||||||
|
|
||||||
|
# Also fine
|
||||||
|
list(
|
||||||
|
total = a + b + c,
|
||||||
|
mean = (a + b + c) / n
|
||||||
|
)
|
||||||
|
\end{lstlisting}
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
% CITE:
|
||||||
|
% https://style.tidyverse.org/index.html
|
||||||
|
% R Programming for Reserach: https://geanders.github.io/RProgrammingForResearch/
|
||||||
|
% Building reproducible analytical pipelines with R: https://raps-with-r.dev/
|
||||||
|
|
||||||
|
\section{Script organisation}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Script header}
|
||||||
|
\begin{itemize}
|
||||||
|
\item It can be very helpful to have some general information right at the
|
||||||
|
top when opening a script
|
||||||
|
\begin{lstlisting}
|
||||||
|
# 01_preprocessing.R
|
||||||
|
#
|
||||||
|
# Cleaning up toy data set (Methods Seminar SS2024)
|
||||||
|
#
|
||||||
|
# Input: rawdata/RDM_MS_SS2024_download_2024-06-07.csv
|
||||||
|
# Output: processed/data_rdm-ms-ss2024_cleaned.csv
|
||||||
|
# processed/data_rdm-ms-ss2024_cleaned.RData
|
||||||
|
#
|
||||||
|
# Created: 2024-06-03, NW
|
||||||
|
\end{lstlisting}
|
||||||
|
\item These metadata help you remember faster what you did
|
||||||
|
\item Might not be necessary when using consistent version control (but does
|
||||||
|
not hurt either)
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Line length}
|
||||||
|
{}
|
||||||
|
\begin{center}
|
||||||
|
{\Large\bf Keep lines to 80 characters or less!}
|
||||||
|
\end{center}
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Good
|
||||||
|
my_df <- data.frame(n = 1:3,
|
||||||
|
letter = c("a", "b", "c"),
|
||||||
|
cap_letter = c("A", "B", "C"))
|
||||||
|
|
||||||
|
# Bad
|
||||||
|
my_df <- data.frame(n = 1:3, letter = c("a", "b", "c"), cap_letter = c("A", "B", "C"))
|
||||||
|
\end{lstlisting}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Ensures that your code is formatted in a way that you can see all of
|
||||||
|
the code without scrolling horizontally
|
||||||
|
\item To set your script pane to be limited to 80 characters, go to\\
|
||||||
|
\verb+RStudio -> Preferences -> Code -> Display+\\
|
||||||
|
and set ``Margin Column'' to 80
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile, allowframebreaks]{File organisation}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Try to write scripts that are concerned with one (major) task
|
||||||
|
\item If you can find a name, that captures the content, it is usually a
|
||||||
|
good way to start
|
||||||
|
\item Some (random) examples
|
||||||
|
\begin{lstlisting}[identifierstyle = \bfseries\color{iwmgray}]
|
||||||
|
download-data.R
|
||||||
|
data-cleaning.R
|
||||||
|
cluster_analysis_exp1.R
|
||||||
|
visualization_logistic-model.R
|
||||||
|
anova_h1.R
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item Export data sets for new scripts (do not make yourself run all scripts
|
||||||
|
up to script 5 each time, just because you need the data in a certain
|
||||||
|
format)
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Interoperable
|
||||||
|
write.table(dat,
|
||||||
|
file = "data_exp1_cleaned.csv",
|
||||||
|
sep = ";",
|
||||||
|
quote = FALSE,
|
||||||
|
row.names = FALSE)
|
||||||
|
|
||||||
|
# Preserve order of factor levels, date formats, etc.
|
||||||
|
save(dat, file = "data_exp1_cleaned.RData")
|
||||||
|
\end{lstlisting}
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile, allowframebreaks]{Internal structure}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Use commented lines with \texttt{-} or \texttt{=} to break your file
|
||||||
|
up into chunks
|
||||||
|
\item Load additional packages at the beginning of the script
|
||||||
|
\begin{lstlisting}
|
||||||
|
library(lme4)
|
||||||
|
library(sjPlot)
|
||||||
|
|
||||||
|
# Load data ---------------------------
|
||||||
|
|
||||||
|
# Plot data ---------------------------
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item If you load several packages, be aware that the order of loading
|
||||||
|
matters!
|
||||||
|
\item If you use only one or two functions from a package, get the function
|
||||||
|
with \verb+::+ instead of loading the whole package
|
||||||
|
\begin{lstlisting}
|
||||||
|
library(lme4)
|
||||||
|
...
|
||||||
|
|
||||||
|
# Fit mixed-effects model to test Hypothesis 1
|
||||||
|
lme1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
|
||||||
|
summary(lme1)
|
||||||
|
sjPlot::tab_model(lme1)
|
||||||
|
\end{lstlisting}
|
||||||
|
\framebreak
|
||||||
|
|
||||||
|
\item Group related pieces of code together
|
||||||
|
\item Separate blocks of code by empty spaces
|
||||||
|
\begin{lstlisting}
|
||||||
|
# Load data
|
||||||
|
library(faraway)
|
||||||
|
data(nepali)
|
||||||
|
|
||||||
|
# Relabel sex variable
|
||||||
|
nepali$sex <- factor(nepali$sex,
|
||||||
|
levels = c(1, 2),
|
||||||
|
labels = c("Male", "Female"))
|
||||||
|
\end{lstlisting}
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\begin{frame}{How can I test if my code is reproducible?}
|
||||||
|
% slido
|
||||||
|
\centering
|
||||||
|
\includegraphics[width = 5cm]{../figures/QR Code for Methodenseminar SS 2024 - Session 5}
|
||||||
|
|
||||||
|
\url{https://app.sli.do/event/uEz8fJWkLBNm1sthQovXNH}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\section{Code reviews}
|
||||||
|
|
||||||
|
\begin{frame}[<+->]{Use your peers}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Do not overthink it!
|
||||||
|
\item Just give your data and code to a colleague and ask them to reproduce
|
||||||
|
what you did (this sounds easy, but it is actually not!)
|
||||||
|
\item This will give you tons of insights about your workflow
|
||||||
|
\begin{itemize}
|
||||||
|
\item Can this person (in general) understand what you did?
|
||||||
|
\item Is this person able to easily put your data on their machine and
|
||||||
|
run the code right away?
|
||||||
|
\item Anything this person would have done differently?
|
||||||
|
\item Discuss why and which things you do differently
|
||||||
|
\end{itemize}
|
||||||
|
\item Reading other peoples's code is the best way to learn about how things
|
||||||
|
can be done differently than you do them
|
||||||
|
\item You can review code by printing it out and adding comments by hand\\
|
||||||
|
(I highly recommend this!)
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\appendix
|
||||||
|
%\begin{frame}[allowframebreaks]{References}
|
||||||
|
\begin{frame}{References}
|
||||||
|
%\renewcommand{\bibfont}{\small}
|
||||||
|
\printbibliography
|
||||||
|
\vfill
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\end{document}
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Last session: Wrap-up
|
||||||
|
|
||||||
|
How to apply all we learned this semester to archiving our research data at the
|
||||||
|
IWM:
|
||||||
|
|
||||||
|
|
||||||
|
* Show how to fill in the input mask
|
||||||
|
|
||||||
|
* Details on how to prepare data and folders
|
||||||
|
|
||||||
|
Show slide set "How to know what to archive"
|
||||||
|
|
||||||
|
* How to upload research data
|
||||||
|
|
||||||
|
* How to create new version of research data
|
||||||
|
|
||||||
|
* How to update meta data
|
||||||
|
|
||||||
|
* Explain the "Status" mechanism
|
||||||
|
|
||||||
|
* Show that only one person per data set has access to the meta data entry
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,408 @@
|
|||||||
|
\documentclass[aspectratio=169]{beamer}
|
||||||
|
|
||||||
|
\usepackage{tikz}
|
||||||
|
\usetikzlibrary{fit}
|
||||||
|
|
||||||
|
\usepackage{listings}
|
||||||
|
\usepackage[utf8,latin1]{inputenc}
|
||||||
|
\usepackage{multirow}
|
||||||
|
\usepackage{color, colortbl}
|
||||||
|
\usepackage{fontawesome5} % get icons
|
||||||
|
|
||||||
|
\makeatletter \def\newblock{\beamer@newblock} \makeatother
|
||||||
|
|
||||||
|
\beamertemplatenavigationsymbolsempty
|
||||||
|
\setbeamertemplate{itemize items}[circle]
|
||||||
|
\setbeamertemplate{section in toc}[circle]
|
||||||
|
\mode<beamer>{\setbeamercolor{math text displayed}{fg=iwmgrau}}
|
||||||
|
\setbeamercolor{block body}{bg=iwmorange!50!white}
|
||||||
|
\setbeamercolor{block title}{fg=white, bg=iwmorange}
|
||||||
|
|
||||||
|
\definecolor{iwmorange}{RGB}{255,105,0}
|
||||||
|
\definecolor{iwmgray}{RGB}{67,79,79}
|
||||||
|
\definecolor{iwmblue}{RGB}{60,180,220}
|
||||||
|
\definecolor{iwmpurple}{RGB}{120,0,75}
|
||||||
|
|
||||||
|
\definecolor{iwmorange}{RGB}{255,105,0}
|
||||||
|
\definecolor{iwmgrau}{RGB}{67,79,79}
|
||||||
|
\setbeamercolor{title}{fg=iwmorange}
|
||||||
|
\setbeamercolor{frametitle}{fg=iwmorange}
|
||||||
|
\setbeamercolor{structure}{fg=iwmorange}
|
||||||
|
\setbeamercolor{normal text}{fg=iwmgrau}
|
||||||
|
\setbeamercolor{author}{fg=iwmgrau}
|
||||||
|
\setbeamercolor{date}{fg=iwmgrau}
|
||||||
|
|
||||||
|
\lstset{language=bash,%
|
||||||
|
literate={Ü}{{\"U}}1
|
||||||
|
{ü}{{\"u}}1,
|
||||||
|
backgroundcolor=\color{iwmgrau!15!white},
|
||||||
|
basicstyle=\ttfamily\color{iwmgrau},
|
||||||
|
frame=none,
|
||||||
|
basicstyle=\ttfamily\color{iwmgrau},
|
||||||
|
commentstyle=\slshape\color{iwmgrau},
|
||||||
|
keywordstyle=\bfseries\color{iwmgrau},
|
||||||
|
identifierstyle=\color{iwmgrau},
|
||||||
|
stringstyle=\color{iwmgrau},
|
||||||
|
numbers=none,%left,numberstyle=\tiny,
|
||||||
|
basewidth={.5em, .4em},
|
||||||
|
showstringspaces=false,
|
||||||
|
emphstyle=\color{red!50!white}}
|
||||||
|
|
||||||
|
\pgfmathdeclarefunction{gauss}{2}{%
|
||||||
|
\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%
|
||||||
|
}
|
||||||
|
|
||||||
|
\AtBeginSection[]{
|
||||||
|
\frame{
|
||||||
|
\tableofcontents[sectionstyle=show/hide, subsectionstyle=show/show/hide]}}
|
||||||
|
|
||||||
|
% \setbeamertemplate{headline}{
|
||||||
|
% \begin{beamercolorbox}{section in head}
|
||||||
|
% \vskip5pt\insertsectionnavigationhorizontal{\paperwidth}{}{}\vskip2pt
|
||||||
|
% \end{beamercolorbox}
|
||||||
|
% }
|
||||||
|
|
||||||
|
\setbeamertemplate{footline}{\vskip-2pt\hfill\insertframenumber$\;$\vskip2pt}
|
||||||
|
|
||||||
|
|
||||||
|
\title{How to know what to archive}
|
||||||
|
\author{Nora Wickelmaier}
|
||||||
|
\date{\today}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\begin{frame}{}
|
||||||
|
\thispagestyle{empty}
|
||||||
|
\titlepage
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{The basics}
|
||||||
|
Data
|
||||||
|
\begin{itemize}
|
||||||
|
\item Keep your raw data in a separate folder
|
||||||
|
\item If your raw data \emph{do not contain any personal data} submit them
|
||||||
|
with your analysis-ready data files
|
||||||
|
\item Submit the analysis script that got your raw data to
|
||||||
|
``analysis-ready`` (or at least a description of the process)\pause\hfill
|
||||||
|
{\bf\color{iwmpurple} Check out our Research Data Policy!}
|
||||||
|
\end{itemize}
|
||||||
|
\pause
|
||||||
|
Material
|
||||||
|
\begin{itemize}
|
||||||
|
\item Submit all materials that have been used to create these data
|
||||||
|
\begin{itemize}
|
||||||
|
\item Questionnaires
|
||||||
|
\item Program code for experiments
|
||||||
|
\item Stimuli presented, e.\,g., pictures or similar
|
||||||
|
\item \dots
|
||||||
|
\end{itemize}
|
||||||
|
\end{itemize}
|
||||||
|
\pause
|
||||||
|
Documentation
|
||||||
|
\begin{itemize}
|
||||||
|
\item Add a description of your data and experiment
|
||||||
|
\item In its simplest form this can just be a README file, ideally as text
|
||||||
|
or PDF file
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Previous folder structure on \texttt{Y:/}}
|
||||||
|
\begin{columns}
|
||||||
|
\begin{column}{.4\textwidth}
|
||||||
|
\begin{tikzpicture}[
|
||||||
|
every node/.style = {text width = 3.6cm, align = left},
|
||||||
|
every path/.style = {thick, draw}
|
||||||
|
]
|
||||||
|
\node[text width = 2cm] (top) at (0, 0) {\faIcon{folder} \verb+study+};
|
||||||
|
% first level
|
||||||
|
\node (n1) at (4, 0) {\faIcon{folder} \verb+data+};
|
||||||
|
\node (n2) at (4, -0.7) {\faIcon{folder} \verb+ethik+};
|
||||||
|
\node (n3) at (4, -1.4) {\faIcon{folder} \verb+material+};
|
||||||
|
\node (n4) at (4, -2.1) {\faIcon{folder} \verb+pub+};
|
||||||
|
\node (n5) at (4, -2.8) {\faIcon{folder} \verb+scans+};
|
||||||
|
\path (top.east) -- (n1.west);
|
||||||
|
\path (top.east) -- (n2.west);
|
||||||
|
\path (top.east) -- (n3.west);
|
||||||
|
\path (top.east) -- (n4.west);
|
||||||
|
\path (top.east) -- (n5.west);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\end{column}
|
||||||
|
\begin{column}{.6\textwidth}
|
||||||
|
\begin{itemize}[<+->]
|
||||||
|
\item Very basic (and good) folder structure for a research project
|
||||||
|
\item Submitting the approval document of our \emph{local} ethics
|
||||||
|
committee is now optional, since the connection will be possible via
|
||||||
|
your meta data\\
|
||||||
|
% $\to$ If the project was evaluated by an external ethics committee it
|
||||||
|
% might still be a good idea to submit the approval document
|
||||||
|
\item Data and material are the most important folders to help other
|
||||||
|
people make sense of your data
|
||||||
|
\end{itemize}
|
||||||
|
\end{column}
|
||||||
|
\end{columns}
|
||||||
|
\vfill
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Some additional suggestions}
|
||||||
|
\vspace{.2cm}
|
||||||
|
\begin{tikzpicture}[
|
||||||
|
every node/.style = {text width = 3.6cm, align = left},
|
||||||
|
every path/.style = {thick, draw}
|
||||||
|
]
|
||||||
|
\node[text width = 2cm] (top) at (0, 0) {\faIcon{folder} \verb+study+};
|
||||||
|
% first level
|
||||||
|
\node (n1) at (4, 0) {\faIcon{folder} \verb+code+};
|
||||||
|
\node (n2) at (4, -0.7) {\faIcon{folder} \verb+data+};
|
||||||
|
\node (n3) at (4, -1.4) {\faIcon{folder} \verb+material+};
|
||||||
|
\node (n4) at (4, -2.1) {\faIcon{folder} \verb+preregistration+};
|
||||||
|
\node (file) at (4, -2.8) {\faIcon[regular]{file} \verb+README.md+};
|
||||||
|
\path (top.east) -- (n1.west);
|
||||||
|
\path (top.east) -- (n2.west);
|
||||||
|
\path (top.east) -- (n3.west);
|
||||||
|
\path (top.east) -- (n4.west);
|
||||||
|
\path (top.east) -- (file.west);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\pause
|
||||||
|
\vfill
|
||||||
|
Separate your code from your data folder and add your preregistration for the
|
||||||
|
project
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Some additional suggestions}
|
||||||
|
\begin{tikzpicture}[
|
||||||
|
every node/.style = {text width = 3.6cm, align = left},
|
||||||
|
every path/.style = {thick, draw}
|
||||||
|
]
|
||||||
|
\node[text width = 2cm] (top) at (0, 0) {\faIcon{folder} \verb+study+};
|
||||||
|
% first level
|
||||||
|
\node (n1) at (4, 0) {\faIcon{folder} \verb+code+};
|
||||||
|
\node (n2) at (4, -0.7) {\faIcon{folder} \verb+data+};
|
||||||
|
\node (n3) at (4, -1.4) {\faIcon{folder} \verb+material+};
|
||||||
|
\node (n4) at (4, -2.1) {\faIcon{folder} \verb+preregistration+};
|
||||||
|
\node (file) at (4, -2.8) {\faIcon[regular]{file} \verb+README.md+};
|
||||||
|
\path (top.east) -- (n1.west);
|
||||||
|
\path (top.east) -- (n2.west);
|
||||||
|
\path (top.east) -- (n3.west);
|
||||||
|
\path (top.east) -- (n4.west);
|
||||||
|
\path (top.east) -- (file.west);
|
||||||
|
% second level
|
||||||
|
\node[text width = 5cm] (o1) at (10, 0) {\faIcon[regular]{file} \verb+01_preprocessing.R+};
|
||||||
|
\node[text width = 5cm] (o2) at (10, -0.7) {\faIcon[regular]{file} \verb+02_descriptives.R+};
|
||||||
|
\node[text width = 5cm] (o3) at (10, -1.4) {\faIcon[regular]{file} \verb+03_modeling.R+};
|
||||||
|
\node[text width = 5cm] (o4) at (10, -2.1) {\faIcon[regular]{file} \verb+04_plots.R+};
|
||||||
|
\path (n1.east) -- (o1.west);
|
||||||
|
\path (n1.east) -- (o2.west);
|
||||||
|
\path (n1.east) -- (o3.west);
|
||||||
|
\path (n1.east) -- (o4.west);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\vfill
|
||||||
|
Separate your code from your data folder and add your preregistration for the
|
||||||
|
project
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Some additional suggestions}
|
||||||
|
\begin{tikzpicture}[
|
||||||
|
every node/.style = {text width = 3.6cm, align = left},
|
||||||
|
every path/.style = {thick, draw}
|
||||||
|
]
|
||||||
|
\node[text width = 2cm] (top) at (0, 0) {\faIcon{folder} \verb+study+};
|
||||||
|
% first level
|
||||||
|
\node (n1) at (4, 0) {\faIcon{folder} \verb+code+};
|
||||||
|
\node (n2) at (4, -0.7) {\faIcon{folder} \verb+data+};
|
||||||
|
\node (n3) at (4, -1.4) {\faIcon{folder} \verb+material+};
|
||||||
|
\node (n4) at (4, -2.1) {\faIcon{folder} \verb+preregistration+};
|
||||||
|
\node (file) at (4, -2.8) {\faIcon[regular]{file} \verb+README.md+};
|
||||||
|
\path (top.east) -- (n1.west);
|
||||||
|
\path (top.east) -- (n2.west);
|
||||||
|
\path (top.east) -- (n3.west);
|
||||||
|
\path (top.east) -- (n4.west);
|
||||||
|
\path (top.east) -- (file.west);
|
||||||
|
% second level
|
||||||
|
\node[text width = 6cm] (o1) at (10.5, -0.7) {\faIcon{folder} \verb+01_raw-data+};
|
||||||
|
\node[text width = 6cm] (o2) at (10.5, -1.4) {\faIcon{folder} \verb+02_processed-data+};
|
||||||
|
\node[text width = 6cm] (o3) at (10.5, -2.1) {\faIcon[regular]{file}
|
||||||
|
\verb+codebook_processed-data.pdf+};
|
||||||
|
\path (n2.east) -- (o1.west);
|
||||||
|
\path (n2.east) -- (o2.west);
|
||||||
|
\path (n2.east) -- (o3.west);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\vfill
|
||||||
|
Separate your code from your data folder and add your preregistration for the
|
||||||
|
project
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Some additional suggestions}
|
||||||
|
\begin{tikzpicture}[
|
||||||
|
every node/.style = {text width = 3.6cm, align = left},
|
||||||
|
every path/.style = {thick, draw}
|
||||||
|
]
|
||||||
|
\node[text width = 2cm] (top) at (0, 0) {\faIcon{folder} \verb+study+};
|
||||||
|
% first level
|
||||||
|
\node (n1) at (4, 0) {\faIcon{folder} \verb+code+};
|
||||||
|
\node (n2) at (4, -0.7) {\faIcon{folder} \verb+data+};
|
||||||
|
\node (n3) at (4, -1.4) {\faIcon{folder} \verb+material+};
|
||||||
|
\node (n4) at (4, -2.1) {\faIcon{folder} \verb+preregistration+};
|
||||||
|
\node (file) at (4, -2.8) {\faIcon[regular]{file} \verb+README.md+};
|
||||||
|
\path (top.east) -- (n1.west);
|
||||||
|
\path (top.east) -- (n2.west);
|
||||||
|
\path (top.east) -- (n3.west);
|
||||||
|
\path (top.east) -- (n4.west);
|
||||||
|
\path (top.east) -- (file.west);
|
||||||
|
% second level
|
||||||
|
\node[text width = 5cm] (o1) at (10, -1.4) {\faIcon{folder} \verb+stimuli+};
|
||||||
|
\node[text width = 5cm] (o2) at (10, -2.1) {\faIcon[regular]{file} \verb+survey01.pdf+};
|
||||||
|
\node[text width = 5cm] (o3) at (10, -2.8) {\faIcon[regular]{file} \verb+survey02.pdf+};
|
||||||
|
\path (n3.east) -- (o1.west);
|
||||||
|
\path (n3.east) -- (o2.west);
|
||||||
|
\path (n3.east) -- (o3.west);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\vfill
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Some additional suggestions}
|
||||||
|
\vspace{.4cm}
|
||||||
|
\begin{tikzpicture}[
|
||||||
|
every node/.style = {text width = 3.6cm, align = left},
|
||||||
|
every path/.style = {thick, draw}
|
||||||
|
]
|
||||||
|
\node[text width = 2cm] (top) at (0, 0) {\faIcon{folder} \verb+study+};
|
||||||
|
% first level
|
||||||
|
\node (n1) at (4, 0) {\faIcon{folder} \verb+code+};
|
||||||
|
\node (n2) at (4, -0.7) {\faIcon{folder} \verb+data+};
|
||||||
|
\node (n3) at (4, -1.4) {\faIcon{folder} \verb+material+};
|
||||||
|
\node (n4) at (4, -2.1) {\faIcon{folder} \verb+preregistration+};
|
||||||
|
\node (file) at (4, -2.8) {\faIcon[regular]{file} \verb+README.md+};
|
||||||
|
\path (top.east) -- (n1.west);
|
||||||
|
\path (top.east) -- (n2.west);
|
||||||
|
\path (top.east) -- (n3.west);
|
||||||
|
\path (top.east) -- (n4.west);
|
||||||
|
\path (top.east) -- (file.west);
|
||||||
|
% second level
|
||||||
|
\node[text width = 6cm] (o1) at (10.5, -2.1) {\faIcon[regular]{file} \verb+2024-06-11_prereg_study.pdf+};
|
||||||
|
\path (n4.east) -- (o1.west);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\pause
|
||||||
|
\vfill
|
||||||
|
A preregistration usually contains all important information like what
|
||||||
|
variables have been collected, what were the hypotheses, etc.
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Some additional suggestions}
|
||||||
|
\begin{columns}
|
||||||
|
\begin{column}{.45\textwidth}
|
||||||
|
\begin{tikzpicture}[
|
||||||
|
every node/.style = {text width = 3.6cm, align = left},
|
||||||
|
every path/.style = {thick, draw}
|
||||||
|
]
|
||||||
|
\node[text width = 2cm] (top) at (0, 0) {\faIcon{folder} \verb+study+};
|
||||||
|
% first level
|
||||||
|
\node (n1) at (4, 0) {\faIcon{folder} \verb+code+};
|
||||||
|
\node (n2) at (4, -0.7) {\faIcon{folder} \verb+data+};
|
||||||
|
\node (n3) at (4, -1.4) {\faIcon{folder} \verb+material+};
|
||||||
|
\node (n4) at (4, -2.1) {\faIcon{folder} \verb+preregistration+};
|
||||||
|
\node (file) at (4, -2.8) {\faIcon[regular]{file} \verb+README.md+};
|
||||||
|
\path (top.east) -- (n1.west);
|
||||||
|
\path (top.east) -- (n2.west);
|
||||||
|
\path (top.east) -- (n3.west);
|
||||||
|
\path (top.east) -- (n4.west);
|
||||||
|
\path (top.east) -- (file.west);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\end{column}
|
||||||
|
\begin{column}{.55\textwidth}
|
||||||
|
\vspace{-3cm}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Add any additional folders that you need
|
||||||
|
\end{itemize}
|
||||||
|
\end{column}
|
||||||
|
\end{columns}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Some additional suggestions}
|
||||||
|
\vspace{1cm}
|
||||||
|
\begin{columns}
|
||||||
|
\begin{column}{.45\textwidth}
|
||||||
|
\begin{tikzpicture}[
|
||||||
|
every node/.style = {text width = 3.6cm, align = left},
|
||||||
|
every path/.style = {thick, draw}
|
||||||
|
]
|
||||||
|
\node[text width = 2cm] (top) at (0, 0) {\faIcon{folder} \verb+study+};
|
||||||
|
% first level
|
||||||
|
\node (n1) at (4, 0) {\faIcon{folder} \bf background};
|
||||||
|
\node (n2) at (4, -0.7) {\faIcon{folder} \verb+code+};
|
||||||
|
\node (n3) at (4, -1.4) {\faIcon{folder} \verb+data+};
|
||||||
|
\node (n4) at (4, -2.1) {\faIcon{folder} \verb+material+};
|
||||||
|
\node (n5) at (4, -2.8) {\faIcon{folder} \verb+preregistration+};
|
||||||
|
\node (file) at (4, -3.5) {\faIcon[regular]{file} \verb+README.md+};
|
||||||
|
\path (top.east) -- (n1.west);
|
||||||
|
\path (top.east) -- (n2.west);
|
||||||
|
\path (top.east) -- (n3.west);
|
||||||
|
\path (top.east) -- (n4.west);
|
||||||
|
\path (top.east) -- (n5.west);
|
||||||
|
\path (top.east) -- (file.west);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\end{column}
|
||||||
|
\begin{column}{.55\textwidth}
|
||||||
|
\vspace{-2.5cm}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Add any additional folders that you need
|
||||||
|
\item Maybe a folder \verb+background+ with a PhD expos{\'e} or a grant
|
||||||
|
application (or both)
|
||||||
|
\end{itemize}
|
||||||
|
\end{column}
|
||||||
|
\end{columns}
|
||||||
|
\vfill
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}[fragile]{Some additional suggestions}
|
||||||
|
\vspace{.5cm}
|
||||||
|
\begin{columns}
|
||||||
|
\begin{column}{.45\textwidth}
|
||||||
|
\begin{tikzpicture}[
|
||||||
|
every node/.style = {text width = 3.6cm, align = left},
|
||||||
|
every path/.style = {thick, draw}
|
||||||
|
]
|
||||||
|
\node[text width = 2cm] (top) at (0, 0) {\faIcon{folder} \verb+study+};
|
||||||
|
% first level
|
||||||
|
\node (n1) at (4, 0) {\faIcon{folder} \verb+code+};
|
||||||
|
\node (n2) at (4, -0.7) {\faIcon{folder} \verb+data+};
|
||||||
|
\node (n3) at (4, -1.4) {\faIcon{folder} \verb+material+};
|
||||||
|
\node (n4) at (4, -2.1) {\faIcon{folder} \verb+preregistration+};
|
||||||
|
\node (n5) at (4, -2.8) {\faIcon{folder} \bf software};
|
||||||
|
\node (file) at (4, -3.5) {\faIcon[regular]{file} \verb+README.md+};
|
||||||
|
\path (top.east) -- (n1.west);
|
||||||
|
\path (top.east) -- (n2.west);
|
||||||
|
\path (top.east) -- (n3.west);
|
||||||
|
\path (top.east) -- (n4.west);
|
||||||
|
\path (top.east) -- (n5.west);
|
||||||
|
\path (top.east) -- (file.west);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\end{column}
|
||||||
|
\begin{column}{.55\textwidth}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Add any additional folders that you need
|
||||||
|
\item Maybe a folder \verb+background+ with a PhD expos{\'e} or a grant
|
||||||
|
application (or both)
|
||||||
|
\item Or a folder \verb+software+ with Python or Matlab code that you
|
||||||
|
wrote for your experiment
|
||||||
|
\item \dots
|
||||||
|
\end{itemize}
|
||||||
|
\vfill
|
||||||
|
\end{column}
|
||||||
|
\end{columns}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{frame}{}
|
||||||
|
{}
|
||||||
|
\begin{center}
|
||||||
|
{\Huge\color{iwmblue} Don't overthink it and use common sense.\\
|
||||||
|
\vspace{1cm}\pause
|
||||||
|
Then add everything that you think a colleague needs to understand what you
|
||||||
|
did.}
|
||||||
|
\end{center}
|
||||||
|
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\end{document}
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
| 2024-06-10 | Data organisation |
|
| 2024-06-10 | Data organisation |
|
||||||
| 2024-06-24 | Data sharing |
|
| 2024-06-24 | Data sharing |
|
||||||
| 2024-07-08 | Clean coding |
|
| 2024-07-08 | Clean coding |
|
||||||
| 2024-07-22 | Version control |
|
| 2024-07-22 | Archiving data at the IWM |
|
||||||
|
|
||||||
# Literature
|
# Literature
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
@@ -1,3 +1,11 @@
|
|||||||
|
@book{Anderson2023,
|
||||||
|
title = {R programming for research},
|
||||||
|
author = {Brooke Anderson and Rachel Severson and Nicholas Good},
|
||||||
|
year = {2023},
|
||||||
|
publisher = {Colorado State University, ERHS 535},
|
||||||
|
url = {https://geanders.github.io/RProgrammingForResearch/}
|
||||||
|
}
|
||||||
|
|
||||||
@article{Kathawalla2021,
|
@article{Kathawalla2021,
|
||||||
title = {Easing into open science: {A} guide for graduate students and their advisors},
|
title = {Easing into open science: {A} guide for graduate students and their advisors},
|
||||||
author = {Kathawalla, Ummul-Kiram and Silverstein, Priya and Syed, Moin},
|
author = {Kathawalla, Ummul-Kiram and Silverstein, Priya and Syed, Moin},
|
||||||
@@ -61,6 +69,12 @@
|
|||||||
doi = {10.1016/j.intell.2012.01.004}
|
doi = {10.1016/j.intell.2012.01.004}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@misc{Wickham_styleguide,
|
||||||
|
author = {Hadley Wickham},
|
||||||
|
title = {The tidyverse style guide},
|
||||||
|
url = {https://style.tidyverse.org/}
|
||||||
|
}
|
||||||
|
|
||||||
@misc{Wilbrandt2023,
|
@misc{Wilbrandt2023,
|
||||||
author = {Wilbrandt, Jeanne},
|
author = {Wilbrandt, Jeanne},
|
||||||
title = {{Research Data Management Intro Series: Coffee Lectures \& Espresso Shots}},
|
title = {{Research Data Management Intro Series: Coffee Lectures \& Espresso Shots}},
|
||||||
|
|||||||
Reference in New Issue
Block a user