-
Notifications
You must be signed in to change notification settings - Fork 37
/
index.Rmd
74 lines (62 loc) · 4.52 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
title: "Getting Used to R, RStudio, and R Markdown"
author: "Chester Ismay and Patrick C. Kennedy"
date: "`r Sys.Date()`"
knit: bookdown::render_book
site: bookdown::bookdown_site
documentclass: book
bibliography: [bib/books.bib, bib/packages.bib, bib/articles.bib]
biblio-style: apalike
link-citations: yes
github-repo: ismayc/rbasics-book
description: "An introduction into using R, RStudio, and R Markdown for new users"
---
```{r setup, include=FALSE}
options(width = 72)
knitr::opts_chunk$set(tidy = FALSE, fig.align = "center", out.width = '\\textwidth')
# automatically create a bib database for R packages
knitr::write_bib(c(
.packages(), 'bookdown', 'knitr', 'rmarkdown','ggplot2', 'vembedr'
), 'bib/packages.bib')
if(file.exists("rbasics.Rmd")) file.remove("rbasics.Rmd")
if(file.exists("rbasics.html")) file.remove("rbasics.html")
gif_link <- function(path, latex = knitr:::is_latex_output()){
webpage <- "https://raw.githubusercontent.com/ismayc/rbasics-book/gh-pages/"
if(latex){
knitr::asis_output(paste0('\\vspace{0.1in}',
'\\begin{center}',
'\\footnotesize{\\url{', webpage, path, '}}',
'\\end{center}',
'\\vspace{0.1in}'))
} else{
knitr::include_graphics(path)
}
}
noindentbold <- function(text, latex = knitr:::is_latex_output()){
if(latex){
paste0('\\vspace*{0.2in}\\noindent\\textbf{', text, '}\\vspace*{0.1in}')
} else{
paste0('**', text, '**')
}
}
embed_my_youtube <- function(id, width = 650, height = 400,
latex = knitr:::is_latex_output(), ...){
if(latex){
knitr::asis_output(paste0('\\vspace{0.1in}',
'\\begin{center}',
'\\footnotesize{\\url{https://www.youtube.com/watch?v=', id, '}}',
'\\end{center}',
'\\vspace{0.1in}'))
}
else {
vembedr::embed_youtube(id, width, height, ...)
}
}
```
# Introduction {#intro}
This book was written to give people who are new to [R](https://www.r-project.org), [RStudio](https://posit.co/downloads/), and [R Markdown](http://rmarkdown.rstudio.com) the tools they need to begin making their own research reproducible. R is an open-source programming language that has seen its popularity grow tremendously in recent years, with developers adding new functionality via packages on a daily basis. RStudio is a graphical development environment that makes it easier to write and view the results of R code, and R Markdown provides an easy way to produce rich, fully-documented, reproducible analyses.
Screenshots and screencasts (with no audio) are used throughout to illustrate key concepts, but if you need further clarification on these or any other aspect, please create a [GitHub issue](https://github.com/ismayc/rbasics-book/issues) or [email me](mailto:[email protected]) with a reference to the area where more guidance is necessary. [Pull requests](https://code.tutsplus.com/courses/git-basics-github-pull-requests) on GitHub for typos or improvements are also welcome, and you can easily do so by clicking on the Edit button near Search at the top of the HTML version of the book.
In the HTML version, you can download the book as a PDF by clicking on the PDF button in the toolbar at the top of the page. Given the heavy use of audio screencasts, HTML is the recommended format for most readers, but the PDF is available for those who need it. Links to the different YouTube videos directly found in the HTML version are provided in the PDF version. You can also download the video files [directly](https://github.com/ismayc/rbasics-book/tree/master/mp4). Just so you know, **no audio** is attached to these screencast videos. They were originally recorded as GIFs, but were then converted to videos hosted on YouTube. Please watch them multiple times if you need to as you read through the text.
This book will evolve and be updated as needed based on reader feedback. You can see when the book was last updated below.
I strongly recommend that you use R version 4.1 or higher, RStudio Desktop version 2024.04.0 or higher, and `rmarkdown` R package version 2.0 or higher. This will ensure that your setup matches the screenshots and recordings, making it easier to follow along. Additionally, you may find that videos don't load sometimes. I haven't had any problems using Google Chrome and recommend that as your browser to view this book if you have trouble with other browsers.
This book was last updated by `r paste(Sys.getenv("LOGNAME"), "on", format(Sys.time(), "%A, %B %d, %Y %X %Z"))`.