Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elaborate on the use of Rmd files #28

Closed
wlandau opened this issue Jul 2, 2018 · 1 comment
Closed

Elaborate on the use of Rmd files #28

wlandau opened this issue Jul 2, 2018 · 1 comment

Comments

@wlandau
Copy link
Member

wlandau commented Jul 2, 2018

In the main example, an Rmd file is responsible for processing the data.


> library(DataPackageR)
> processing_code <- system.file(
+   "extdata", "tests", "subsetCars.Rmd", package = "DataPackageR"
+ )
> cat(readLines(processing_code), sep = "\n")
---
title: "Test DataPackageR"
author: "Greg Finak"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see .

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r cars}
summary(cars)
```

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

```{r}
cars_over_20 = subset(cars, speed > 20)
```

I can see how DataPackageR can grab cars_over_20 from the environment of the knitr document.

https://github.com/RGLab/DataPackageR/blob/cb23c6b7f862798706339858e81da4a004dc1712/R/processData.R#L211-L216

However, other new users may not understand this at first. I think you can elaborate on how DataPackageR finds and saves cars_over_20, and I think the right place to do it is inside the body of the above Rmd document. I am not sure you need the default text in the "R Markdown" section either.

gfinak added a commit that referenced this issue Jul 2, 2018
- describe how objects are passed around between rmd files.
@wlandau
Copy link
Member Author

wlandau commented Jul 6, 2018

The new Rmd writeup is super thorough. Nicely done.

@wlandau wlandau closed this as completed Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants