Skip to content

FAQ and Trouble shooting

vertesy edited this page Aug 2, 2018 · 2 revisions

If you encounter an error please report it in the issues section.

F.A.Q.

1. What is the difference between R Markdown (of Rstudio) and MarkdownReports?

Feature R Markdown MarkdownReports
Code and Report Together: Almost full markdown syntax in the R source code, and R code in the final report. (E.g. tables have extensive syntax) Separate: A report with text and figures only (code can be included) and the R source code with minimal to no markdown syntax.
Emphasis / Aim Explaining a workflow step by step Easy, scientific presentation of the results of your analysis.
Output "Knit" (export) to a single html or pdf file, etc. A markdown file, with figures (.pdf) displayed in-line. Can be further exported to html or pdf.
Figures By generic R plotting functions. Quick generation of correctly labeled plots. Convenience features, e.g.: easy display of filtering by thresholds, 1D or 2D error-bars, etc. Saved as saved as vector graphic can use it in any presentation.

2. How should I name axes, titles etc of plots?

By naming the variable.

  • The name of the variable is used as the Title of the plot and as the name of the file.
  • Dimension names (names, row names, column names) are used to label axes.
Cherry_size_vs_sugar_contnent_in_2015 = cbind (
		"Size [cm]" = c(1,2,1,2,2,2,3,1),
		"Sugar Content [% dry weight]" = c(3,5,7,6,2,3,9,4) )
)

wplot(Cherry_size_vs_sugar_contnent_in_2015)

3. How to preview .md files in finder?

There’s an easy fix [...] in form of Phil Toland’s QLMarkdown. Installing it is easy:

  1. Download the latest release by clicking here.
  • Extract it somewhere temporarily and copy the QLMarkdown.qlgenerator file into ~/Library/QuickLook (you may need to create this directory).
  • Relaunch Finder by alt+right-clicking on the icon in the dock and selecting the option at the bottom.

Quoted from moss.io

4. Add gridlines to a plot as seen in ggplot

Simply pass the ..., panel.first=grid() argument to wplot:

DATA = cbind(rnorm(100), rnorm(100)); 
wplot(DATA, panel.first=grid())

# Vertical grid only
wplot(DATA, panel.first=grid(nx=NULL, ny=0))

# Horizontal grid only
wplot(DATA, panel.first=grid(nx=0, ny=NULL))

5. Linking plots to the markdown file

You can link the plots created to the markdown file by:

  • Set the argument b.mdlink = TRUE in setup_MarkdownReports() (DEFAULT, every plot is linked)
  • If you set b.mdlink = FALSE , you can still set mdlink = TRUE for individual plot inside each plotting function.
  • NOTE: wplot_save_this() is an exception, that it has mdlink = FALSE by default. The reason why it does not insert a link by default, is because it is most often called after another wplot* function, which has already inserted a link.

Simply pass the ..., panel.first=grid() argument to wplot:







Trouble shooting

If you encounter an error that a function is missing, it might be a missing dependency on CodeAndRoll. Try to:

   source("https://raw.githubusercontent.com/vertesy/TheCorvinas/master/R/CodeAndRoll.R")