-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d0d2a8
commit e8a921c
Showing
49 changed files
with
59,044 additions
and
8,136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,15 @@ | ||
# RStudio & Basics | ||
|
||
![](/Users/Mathias2/Documents/R/WORKING_DIRECTORY/Windows/R/WORKING_DIRECTORY/Meta-Analyse Buch/bookdown-demo-master/chap2.jpg) | ||
![](chap2.jpg) | ||
|
||
```{block,type='rmdinfo'} | ||
Before we start with our meta-analysis, we have to download and prepare a **computer program** which allows us to use *R* for programming. | ||
|
||
Probably the best option for this at the moment is **RStudio**. This program gives us a user interface which makes it easier to overlook our data, packages and output. The best part is that RStudio is **completely free** and can be downloaded anytime. | ||
|
||
In this Chapter, we'll focus on how you can install RStudio on your computer. We'll also provide some general information on R, and how you can get help if you get error messages. | ||
Before we start with our meta-analysis, we have to download and prepare a **computer program** which allows us to use *R* for programming. Probably the best option for this at the moment is **RStudio**. This program gives us a user interface which makes it easier to overlook our data, packages and output. The best part is that RStudio is **completely free** and can be downloaded anytime.In this Chapter, we'll focus on how you can install RStudio on your computer. We'll also provide some general information on R, and how you can get help if you get error messages.If you already have RStudio installed on your computer, and if you're an experienced R user already, all of this might be nothing new for you. You may **skip** this chapter then.Especially if you have **never used R before, we would like to consider this Chapter essential**, as it gives you some input on how R works, and how we can use it for our data analyses. | ||
|
||
If you already have RStudio installed on your computer, and if you're an experienced R user already, all of this might be nothing new for you. You may **skip** this chapter then. | ||
|
||
Especially if you have **never used R before, we would like to consider this Chapter essential**, as it gives you some input on how R works, and how we can use it for our data analyses. | ||
``` | ||
|
||
<br><br> | ||
|
||
--- | ||
|
||
## Getting RStudio to run on your computer {#RStudio} | ||
```{r, echo=FALSE, fig.width=3,fig.height=2} | ||
library(png) | ||
library(grid) | ||
img <- readPNG("C:/Users/Admin/Documents/R/WORKING_DIRECTORY/Meta-Analyse Buch/bookdown-demo-master/rstudiologo.PNG") | ||
grid.raster(img) | ||
``` | ||
|
||
|
||
As a prerequisite for this guide, you need to have **RStudio** and a few essential **R packages** installed. | ||
|
||
|
@@ -35,42 +20,35 @@ As a prerequisite for this guide, you need to have **RStudio** and a few essenti | |
3. Once RStudio is running, open the **Console** on the bottom left corner of your screen. | ||
4. We will now install a few packages using R Code. Here's an overview of the packages, and why we need them: | ||
|
||
```{r,echo=FALSE} | ||
```{r,echo=FALSE, message=FALSE, warning=FALSE} | ||
library(kableExtra) | ||
Package<-c("tidyverse","meta","metafor") | ||
Description<-c("This is a large package containing various functions to tidy up your data", "This package is a so-called wrapper for many meta-analytic functions and makes it easy to code different meta-analyses","This package is used by the meta package for many applications, so we need to have it installed") | ||
m<-data.frame(Package,Description) | ||
names<-c("Package", "Description") | ||
colnames(m)<-names | ||
kable(m) | ||
kable(m) %>% | ||
column_spec(2, width = "40em") | ||
``` | ||
|
||
<br><br> | ||
5. To install these packages, we use the `install.packages()` function in R. One package after another, our code should look like this: | ||
$~$ | ||
|
||
To install these packages, we use the `install.packages()` function in R. One package after another, our code should look like this: | ||
|
||
```{r, eval=FALSE} | ||
install.packages("tidyverse") | ||
install.packages("meta") | ||
install.packages("metafor") | ||
``` | ||
|
||
```{block, type='rmdachtung'} | ||
Don't forget to put the packages in `""`. | ||
Otherwise, you will get an error message. | ||
``` | ||
|
||
<br><br> | ||
$~$ | ||
|
||
**You are now set and ready to proceed. Below, you can find some basic information on RStudio and troubleshooting** | ||
Don't forget to put the packages in `""`. Otherwise, you will get an error message. **You are now set and ready to proceed. Below, you can find some basic information on RStudio and troubleshooting** | ||
|
||
### Running R Code | ||
|
||
Order to get the most out of this guide, it's helpful (but not essential) if you have some programming experience already. If you’ve never programmed before, you might find ***Hands-On Programming with R*** [@grolemund2014hands] to be a useful primer. | ||
|
||
There are three things you need to run the code: **R**, **RStudio**, and collection of **R packages**. Packages are the fundamental units of reproducible R code. They include reusable functions, the documentation that describes how to use them, and sample data. | ||
|
||
Gladly, once you've reached this point successfully, these three things are set already. Nevertheless, we will have to install and load a few new packages at some place in this guide, for which you can use the `install.packages()` the same way as you did before. | ||
Order to get the most out of this guide, it's helpful (but not essential) if you have some programming experience already. If you’ve never programmed before, you might find **Hands-On Programming with R** [@grolemund2014hands] to be a useful primer. There are three things you need to run the code: **R**, **RStudio**, and collection of **R packages**. Packages are the fundamental units of reproducible R code. They include reusable functions, the documentation that describes how to use them, and sample data. Gladly, once you've reached this point successfully, these three things are set already. Nevertheless, we will have to install and load a few new packages at some place in this guide, for which you can use the `install.packages()` the same way as you did before. | ||
|
||
|
||
Throughout the guide, a consistent set of conventions is used to refer to code: | ||
|
@@ -92,9 +70,7 @@ more likely to find help for English error messages.) | |
* If Google doesn’t help, try [stackoverflow](https://stackoverflow.com). Start by spending a little time searching for an existing answer; including [R] restricts your search to questions and answers that use R. | ||
* Lastly, if you stumble upon an error (or typos!) in this guide's text or R syntax, feel free to contact **Mathias Harrer** at **[email protected]**. | ||
|
||
<br><br> | ||
|
||
--- | ||
|
||
|
||
|
Oops, something went wrong.