Categories
status

Turn numeric into categorical data AdultUCI age…

Turn numeric into categorical data.

AdultUCI[["age"]] <- ordered(cut(AdultUCI[["age"]], c(15,25,45,65,100)), labels = c("Young", "Middle-aged", "Senior", "Old"))
Categories
status

Two column for LaTeX from Pandoc Add twocolumn…

Two column for LaTeX from Pandoc.

Add twocolumn and replace longtable with supertabular.

\documentclass[twocolumn]{article}
...
\usepackage{supertabular}
...
\begin{supertabular}[c]{@{}lll@{}}
...
\end{supertabular}

To make a figure span over two columns, use figure*.

\begin{figure*}[htbp]
...
\end{figure*}
Categories
status

Diff sort output diff

Diff sort output.

diff <(sort file1) <(sort file2)
Categories
status

Change the order of discrete axis Generate a…

Change the order of discrete axis.

Generate a factor with reversed levels or use a new ggplot2 option.

Examples.

df$X1 = with(df, factor(X1, levels = rev(levels(X1))))

http://stackoverflow.com/questions/7418191/sorting-dotplot-factor-axis-in-ggplot

  1. Reverse the order of a discrete-valued axis
  2. Get the levels of the factor
flevels <- levels(PlantGrowth$group)
  1. "ctrl" "trt1" "trt2"
  2. Reverse the order
flevels <- rev(flevels)
  1. "trt2" "trt1" "ctrl"
bp + scale_x_discrete(limits=flevels)

http://www.cookbook-r.com/Graphs/Axes_(ggplot2)/#reversing-the-direction-of-an-axis