jeromyanglim / rmarkdown-rmeetup-2012 Goto Github PK
View Code? Open in Web Editor NEWReproducible analysis with knitr, R Markdown, and RStudio: Slides and example R Markdown files from the presentation
Home Page: http://jeromyanglim.blogspot.com
Reproducible analysis with knitr, R Markdown, and RStudio: Slides and example R Markdown files from the presentation
Home Page: http://jeromyanglim.blogspot.com
I have a few github repositories that have multiple R Markdown files with each R Markdown file in a separate folder.
I want to be able upload these repositories and I want the images to display when someone clicks on a Markdown file.
At the moment, it's accessing the blob
version and not the raw
version, which is causing issues.
I asked about a general solution to the problem on Stack Overflow.
A general solution is to change the base.url
setting
opts_knit$set(base.url='https://github.com/.../raw/.../')
For one particular file I wrote the following:
```{r echo = FALSE}
github_baseurl <- 'https://github.com/jeromyanglim/gelman-bayesian-data-analysis/raw/master/'
filepath <- strsplit(getwd(), '/')[[1]]
# assumes that markdown file is stored in a folder below master
markdown_folder <- filepath[length(filepath)]
image_base_url <- paste0(github_baseurl, markdown_folder, '/')
opts_knit$set(base.url=image_base_url)
```
However, this needs to be done at the very end otherwise preliminary compilations will not display properly on the local computer because the images are not available on github.
Thus, I'm looking for a general solution to this problem.
This also links into my general need to have a single makefile that will convert rmd files to md files in all folders of a repo with github friendly images.
On Windows, I used to press print screen then select the region and then paste into the document.
For markdown, beamer, latex, etc. I need to save the file in a particular location with a relevant name and then incorporate the name into the source file.
What's a quick way of doing that?
I was wanting to conceptualise reproducible data analysis in a broader context.
I've found that using the default image option,
![my image](My_image.png)
that the image was way too large.
What is a good strategy for incorporating images into slides at the appropriate size?
I run Linux, but I sometimes need to give an R script to someone to run an automated production process involving knitr that is going to run on Windows. The user of the script does not necessarily no much about R and their machine does not come pre-configured for R or knitr.
What steps need to be taken?
Clearly most researchers don't anlayse their data with reproducible data analysis tools like knitr and Sweave.
For practical purposes I operationalise reproducible analysis as:
knitr or sweave with R and LaTeX and a build script such as a makefile shared as a self-contained archive file is one way of satisfying the above criteria.
I really like the minimum fuss of markdown to beamer-pdf. However, there is the tension that sooner or later you don't like the default choices made or you want to take advantage of powerful features.
Thus,
To a certain extent latex will be just passed through, but sometimes you want to override the default behaviour of Markdon to LaTeX.
Also, sometimes I want to add header information.
I issue this command:
$ pandoc -o talk.tex talk.md
and I get this error message
pandoc:
Error:
"source" (line 112, column 1):
unexpected end of input
expecting "\\" or "$"
It seems to emerge once I add
\begin{document}
to my pandoc file. How can this be fixed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.