Skip to content
Browse files

Merge branch 'master' of https://github.com/andrie/braid

Conflicts:
	DESCRIPTION
	NAMESPACE
	NEWS
	R/braid-package.R
	R/braid.R
	R/braidSave.R
	inst/tests/test-1-braid-object.R
	inst/tests/test-2-braid-functions.R
	inst/tests/test-3-plotCache.R
	inst/tests/test-4-braidSave.R
	inst/tests/test-5-compile.R
	man/braidCompile.Rd
	man/braidSave.Rd
  • Loading branch information...
2 parents 5c9f1e3 + 03a698d commit 09adbf88f31de27afcbb813e7123860dbd25c4bc @andrie committed Jul 13, 2012
View
12 DESCRIPTION
@@ -12,6 +12,7 @@ Description: This package tries to solve the problem of
creation of PDF files via LaTEX only.
Author@R: person("Andrie", "de Vries",
email="andrie@pentalibra.com")
+<<<<<<< HEAD
Version: 0.1-07
URL: https://github.com/andrie/braid
Date: 2012-07-13
@@ -20,6 +21,17 @@ Imports:
Hmisc,
tools,
plyr
+=======
+Version: 0.1-06
+URL: https://github.com/andrie/braid
+Date: 2012-06-25
+ByteCompile: yes
+Imports:
+ plyr,
+ Hmisc,
+ xtable,
+ tools
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
Suggests:
lattice,
ggplot2
View
9 NAMESPACE
@@ -1,5 +1,8 @@
+<<<<<<< HEAD
S3method(braidCompile,default)
S3method(braidSave,default)
+=======
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
export(as.braid)
export(braidCompile)
export(braidFilename)
@@ -10,7 +13,13 @@ export(braidSave)
export(braidWrite)
export(is.braid)
export(latexTranslate)
+<<<<<<< HEAD
importFrom(Hmisc,"%nin%")
importFrom(Hmisc,"substring2<-")
importFrom(Hmisc,sedit)
importFrom(plyr,laply)
+=======
+import(Hmisc)
+import(tools)
+import(xtable)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
View
3 NEWS
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
braid 0.1-07 (13/7/2012)
------------
@@ -11,6 +12,8 @@ Changes
* Changed braidSave() and braidCompile() to S3 methods, each with default method. This enables extensions, such as braidppt (a stand-alone package)
+=======
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
braid 0.1-05 (12/5/2012)
------------
View
6 R/braid-package.R
@@ -33,10 +33,16 @@
#' @name braid-package
#' @aliases braid braid-package
#' @docType package
+<<<<<<< HEAD
#' @title A report writing system to create latex output from R.
#' @author Andrie de Vries \email{andrie.de.vries@@pentalibra.com}
#' @importFrom Hmisc sedit %nin% substring2<-
#' @importFrom plyr laply
+=======
+#' @import Hmisc xtable tools
+#' @title A report writing system to create latex output from R.
+#' @author Andrie de Vries \email{andrie.de.vries@@pentalibra.com}
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
#' @keywords package
NULL
View
8 R/braid.R
@@ -58,6 +58,7 @@ braidFilename <- function(b, counter=braidIncCounter(b),
#------------------------------------------------------------------------------
+<<<<<<< HEAD
#' Compiles braid object.
#'
#' @param b Object
@@ -67,6 +68,8 @@ braidCompile <- function(b, ...){
UseMethod("braidCompile")
}
+=======
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
#' Compiles braid latex file to PDF.
#'
#' This is a wrapper around \code{\link[tools]{texi2dvi}} to convert a latex file to PDF output. No other formats are currently supported.
@@ -75,10 +78,15 @@ braidCompile <- function(b, ...){
#' @param fileOuter File location of a latex file
#' @param output Determines what type of output to produce. Default to "pdf", currently the only supported format
#' @param useXelatex If TRUE, uses \code{xelatex} to compile the latex. If FALSE, uses \code{\link[tools]{texi2dvi}}. If "guess", it uses a heuristic to see whether \code{xelatex} should be used or not: it searches for \code{\\usepackage\{xe*\}} in the latexfile; if found, uses \code{xelatex} otherwise texi2dvi.
+<<<<<<< HEAD
#' @param ... Ignored
#' @method braidCompile default
#' @export
braidCompile.default <- function(b, fileOuter=b$fileOuter, output="pdf", useXelatex = TRUE, ...){
+=======
+#' @export
+braidCompile <- function(b, fileOuter=b$fileOuter, output="pdf", useXelatex = TRUE){
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
# Determine whether file exists
if(!file.exists(fileOuter)) stop(paste("In braidCompile: file doesn't exist:", fileOuter))
old_wd <- getwd()
View
14 R/braidSave.R
@@ -8,6 +8,7 @@
#'
#' Writes result to braid output file.
#'
+<<<<<<< HEAD
#' @param b object
#' @export
braidSave <- function(b){
@@ -30,6 +31,19 @@ braidSave.default <- function(b){
braidSavePlot(b)
braidAppendPlot(b, reset=TRUE)
+=======
+#' @param braid A braid object
+#' @export
+braidSave <- function(braid){
+ text <- braidAppendText(braid)
+ sfile <- file(braid$fileInner, "at") ### Open file in append mode
+ on.exit(close(sfile))
+ cat(text, file=sfile, append=TRUE)
+ braidAppendText(braid, reset=TRUE)
+
+ braidSavePlot(braid)
+ braidAppendPlot(braid, reset=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
invisible(NULL)
}
View
10 inst/tests/test-1-braid-object.R
@@ -5,9 +5,15 @@
path <- tempdir()
latex_path <- file.path(path, "latex")
+<<<<<<< HEAD
dir.create(latex_path, showWarnings=FALSE, recursive=TRUE)
graph_path <- file.path(latex_path, "graphics")
dir.create(graph_path, showWarnings=FALSE, recursive=TRUE)
+=======
+dir.create(latex_path, recursive=TRUE)
+graph_path <- file.path(latex_path, "graphics")
+dir.create(graph_path, recursive=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
sinkfile <- file.path(latex_path, "braid_test.tex")
clearFiles <- function(){
@@ -112,6 +118,10 @@ test_that("plotAppender correctly appends third value", {
braidSave(b)
clearFiles()
+<<<<<<< HEAD
+=======
+unlink(path, recursive=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
View
10 inst/tests/test-2-braid-functions.R
@@ -8,9 +8,15 @@
path <- tempdir()
latex_path <- file.path(path, "latex")
+<<<<<<< HEAD
dir.create(latex_path, showWarnings=FALSE, recursive=TRUE)
graph_path <- file.path(latex_path, "graphics")
dir.create(graph_path, showWarnings=FALSE, recursive=TRUE)
+=======
+dir.create(latex_path, recursive=TRUE)
+graph_path <- file.path(latex_path, "graphics")
+dir.create(graph_path, recursive=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
sinkfile <- file.path(latex_path, "braid_test.tex")
clearFiles <- function(){
@@ -112,3 +118,7 @@ test_that("braidPlot saves trellis plot", {
clearFiles()
+<<<<<<< HEAD
+=======
+unlink(path, recursive=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
View
10 inst/tests/test-3-plotCache.R
@@ -6,9 +6,15 @@
path <- tempdir()
latex_path <- file.path(path, "latex")
+<<<<<<< HEAD
dir.create(latex_path, showWarnings=FALSE, recursive=TRUE)
graph_path <- file.path(latex_path, "graphics")
dir.create(graph_path, showWarnings=FALSE, recursive=TRUE)
+=======
+dir.create(latex_path, recursive=TRUE)
+graph_path <- file.path(latex_path, "graphics")
+dir.create(graph_path, recursive=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
sinkfile <- file.path(latex_path, "braid_test.tex")
clearFiles <- function(){
@@ -95,3 +101,7 @@ test_that("plotCache individual tests are correct", {
braidSave(b)
clearFiles()
+<<<<<<< HEAD
+=======
+unlink(path, recursive=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
View
10 inst/tests/test-4-braidSave.R
@@ -6,9 +6,15 @@
path <- tempdir()
latex_path <- file.path(path, "latex")
+<<<<<<< HEAD
dir.create(latex_path, showWarnings=FALSE, recursive=TRUE)
graph_path <- file.path(latex_path, "graphics")
dir.create(graph_path, showWarnings=FALSE, recursive=TRUE)
+=======
+dir.create(latex_path, recursive=TRUE)
+graph_path <- file.path(latex_path, "graphics")
+dir.create(graph_path, recursive=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
sinkfile <- file.path(latex_path, "braid_test.tex")
clearFiles <- function(){
@@ -80,3 +86,7 @@ test_that("braidSave saves files in correct format", {
})
clearFiles()
+<<<<<<< HEAD
+=======
+unlink(path, recursive=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
View
10 inst/tests/test-5-compile.R
@@ -5,9 +5,15 @@
path <- tempdir()
latex_path <- file.path(path, "latex")
+<<<<<<< HEAD
dir.create(latex_path, showWarnings=FALSE, recursive=TRUE)
graph_path <- file.path(latex_path, "graphics")
dir.create(graph_path, showWarnings=FALSE, recursive=TRUE)
+=======
+dir.create(latex_path, recursive=TRUE)
+graph_path <- file.path(latex_path, "graphics")
+dir.create(graph_path, recursive=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
sinkfile <- file.path(latex_path, "braid_test.tex")
clearFiles <- function(){
@@ -69,3 +75,7 @@ test_that("braid file gets compiled",{
clearFiles()
+<<<<<<< HEAD
+=======
+unlink(path, recursive=TRUE)
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
View
27 man/braidCompile.Rd
@@ -1,5 +1,6 @@
\name{braidCompile}
\alias{braidCompile}
+<<<<<<< HEAD
\title{Compiles braid object.}
\usage{
braidCompile(b, ...)
@@ -11,5 +12,31 @@
}
\description{
Compiles braid object.
+=======
+\title{Compiles braid latex file to PDF.}
+\usage{
+ braidCompile(b, fileOuter = b$fileOuter, output = "pdf",
+ useXelatex = TRUE)
+}
+\arguments{
+ \item{b}{A braid object}
+
+ \item{fileOuter}{File location of a latex file}
+
+ \item{output}{Determines what type of output to produce.
+ Default to "pdf", currently the only supported format}
+
+ \item{useXelatex}{If TRUE, uses \code{xelatex} to compile
+ the latex. If FALSE, uses \code{\link[tools]{texi2dvi}}.
+ If "guess", it uses a heuristic to see whether
+ \code{xelatex} should be used or not: it searches for
+ \code{\\usepackage\{xe*\}} in the latexfile; if found,
+ uses \code{xelatex} otherwise texi2dvi.}
+}
+\description{
+ This is a wrapper around \code{\link[tools]{texi2dvi}} to
+ convert a latex file to PDF output. No other formats are
+ currently supported.
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
}
View
7 man/braidSave.Rd
@@ -2,10 +2,17 @@
\alias{braidSave}
\title{Writes result to braid output file.}
\usage{
+<<<<<<< HEAD
braidSave(b)
}
\arguments{
\item{b}{object}
+=======
+ braidSave(braid)
+}
+\arguments{
+ \item{braid}{A braid object}
+>>>>>>> 03a698d53a139e14f9fda73084583835cb609986
}
\description{
Writes result to braid output file.

0 comments on commit 09adbf8

Please sign in to comment.
Something went wrong with that request. Please try again.