Running examples in ‘connect3-Ex.R’ failed
The error most likely occurred in:

> ### Name: write.rtf
> ### Title: A function for writing Rich Text Format (rtf) files
> ### Aliases: write.rtf
> 
> ### ** Examples
> 
> ##Example 1
> #Read a sample LaTeX file
> file<-'connect3-minimal.tex'
> filepath<-paste(sub("examples/.*","\\1",
+           system.file("examples","connect3-minimal.tex",package="connect3")),
+           "examples", sep='')
> obj<-read.latex(file, filepath)
> obj
$tex
[1] "Connect3BEGIN \\documentclass[11pt, a4paper]{article}\\usepackage[]{graphicx}\\usepackage[]{color}Connect3END Connect3BEGIN %% maxwidth is the original width if it is less than linewidthConnect3END Connect3BEGIN %% otherwise use linewidth (to make sure the graphics do not exceed the margin)Connect3END Connect3BEGIN \\makeatletterConnect3END Connect3BEGIN \\def\\maxwidth{ %Connect3END Connect3BEGIN   \\ifdim\\Gin@nat@width>\\linewidthConnect3END Connect3BEGIN     \\linewidthConnect3END Connect3BEGIN   \\elseConnect3END Connect3BEGIN     \\Gin@nat@widthConnect3END Connect3BEGIN   \\fiConnect3END Connect3BEGIN }Connect3END Connect3BEGIN \\makeatotherConnect3END Connect3BEGIN Connect3END Connect3BEGIN \\definecolor{fgcolor}{rgb}{0.251, 0.251, 0.251}Connect3END Connect3BEGIN \\newcommand{\\hlnum}[1]{\\textcolor[rgb]{0.502,0.086,1}{#1}}%Connect3END Connect3BEGIN \\newcommand{\\hlstr}[1]{\\textcolor[rgb]{1,0.4,0.2}{#1}}%Connect3END Connect3BEGIN \\newcommand{\\hlcom}[1]{\\textcolor[rgb]{1,0.251,0.502}{#1}}%Connect3END Connect3BEGIN \\newcommand{\\hlopt}[1]{\\textcolor[rgb]{0.251,0.251,0.251}{#1}}%Connect3END Connect3BEGIN \\newcommand{\\hlstd}[1]{\\textcolor[rgb]{0.251,0.251,0.251}{#1}}%Connect3END Connect3BEGIN \\newcommand{\\hlkwa}[1]{\\textcolor[rgb]{0.941,0.188,0.816}{#1}}%Connect3END Connect3BEGIN \\newcommand{\\hlkwb}[1]{\\textcolor[rgb]{0,0.439,0.902}{#1}}%Connect3END Connect3BEGIN \\newcommand{\\hlkwc}[1]{\\textcolor[rgb]{0.188,0.941,0.314}{#1}}%Connect3END Connect3BEGIN \\newcommand{\\hlkwd}[1]{\\textcolor[rgb]{0.69,0.188,0.941}{#1}}%Connect3END Connect3BEGIN Connect3END Connect3BEGIN \\usepackage{framed}Connect3END Connect3BEGIN \\makeatletterConnect3END Connect3BEGIN \\newenvironment{kframe}{%Connect3END Connect3BEGIN  \\def\\at@end@of@kframe{}%Connect3END Connect3BEGIN  \\ifinner\\ifhmode%Connect3END Connect3BEGIN   \\def\\at@end@of@kframe{\\end{minipage}}%Connect3END Connect3BEGIN   \\begin{minipage}{\\columnwidth}%Connect3END Connect3BEGIN  \\fi\\fi%Connect3END Connect3BEGIN  \\def\\FrameCommand##1{\\hskip\\@totalleftmargin \\hskip-\\fboxsepConnect3END Connect3BEGIN  \\colorbox{shadecolor}{##1}\\hskip-\\fboxsepConnect3END Connect3BEGIN      % There is no \\\\@totalrightmargin, so:Connect3END Connect3BEGIN      \\hskip-\\linewidth \\hskip-\\@totalleftmargin \\hskip\\columnwidth}%Connect3END Connect3BEGIN  \\MakeFramed {\\advance\\hsize-\\widthConnect3END Connect3BEGIN    \\@totalleftmargin\\z@ \\linewidth\\hsizeConnect3END Connect3BEGIN    \\@setminipage}}%Connect3END Connect3BEGIN  {\\par\\unskip\\endMakeFramed%Connect3END Connect3BEGIN  \\at@end@of@kframe}Connect3END Connect3BEGIN \\makeatotherConnect3END Connect3BEGIN Connect3END Connect3BEGIN \\definecolor{shadecolor}{rgb}{.97, .97, .97}Connect3END Connect3BEGIN \\definecolor{messagecolor}{rgb}{0, 0, 0}Connect3END Connect3BEGIN \\definecolor{warningcolor}{rgb}{1, 0, 1}Connect3END Connect3BEGIN \\definecolor{errorcolor}{rgb}{1, 0, 0}Connect3END Connect3BEGIN \\newenvironment{knitrout}{}{} % an empty environment to be redefined in TeXConnect3END Connect3BEGIN Connect3END Connect3BEGIN \\usepackage{alltt}Connect3END Connect3BEGIN \\usepackage{graphicx, color, fancyhdr, lastpage, bm, amsmath, multirow, colortbl, setspace, url, ulem, hyperref, rotating, subfigure, lineno, currfile,longtable,ctable,lscape,geometry}Connect3END Connect3BEGIN \\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}Connect3END Connect3BEGIN \\begin{document}Connect3END Connect3BEGIN Connect3END Connect3BEGIN Connect3END Connect3BEGIN \\title{A Minimal Demo of connect3}Connect3END Connect3BEGIN \\author{Chunqiao Luo}Connect3END Connect3BEGIN \\maketitleConnect3END Connect3BEGIN Connect3END Connect3BEGIN \\section{Introduction}Connect3END Connect3BEGIN Package 'connect3' converts LaTeX files (with extension .tex) generated by R Sweave using package 'knitr' o Rich Text Format (RTF) files. Features include: Connect3END Connect3BEGIN \\begin{itemize}Connect3END Connect3BEGIN \\item conversion of R syntax highlightingConnect3END Connect3BEGIN \\item conversion of tables generated by Hmisc::describe, Hmisc::summary, and Hmisc::latexConnect3END Connect3BEGIN \\item conversion of mathematical equationsConnect3END Connect3BEGIN \\item conversion of graphicsConnect3END Connect3BEGIN \\item conversion of itemize and enumerateConnect3END Connect3BEGIN \\item conversion of referencesConnect3END Connect3BEGIN \\end{itemize}Connect3END Connect3BEGIN Connect3END Connect3BEGIN \\section{Table}Connect3END Connect3BEGIN \\begin{knitrout}Connect3END Connect3BEGIN \\definecolor{shadecolor}{rgb}{0.973, 0.973, 0.973}\\color{fgcolor}\\begin{kframe}Connect3END Connect3BEGIN \\begin{alltt}Connect3END Connect3BEGIN \\hlcom{#Data Generation}Connect3END Connect3BEGIN \\hlkwd{set.seed}\\hlstd{(}\\hlnum{123}\\hlstd{)}Connect3END Connect3BEGIN \\hlstd{StudyID}\\hlkwb{<-}\\hlkwd{seq}\\hlstd{(}\\hlnum{1}\\hlopt{:}\\hlnum{100}\\hlstd{)}Connect3END Connect3BEGIN \\hlstd{gender}\\hlkwb{<-}\\hlkwd{rep}\\hlstd{(}\\hlkwd{c}\\hlstd{(}\\hlstr{\"Male\"}\\hlstd{,}\\hlstr{\"Female\"}\\hlstd{),}\\hlkwc{times}\\hlstd{=}\\hlnum{50}\\hlstd{)}Connect3END Connect3BEGIN \\hlstd{age}\\hlkwb{<-}\\hlkwd{rnorm}\\hlstd{(}\\hlnum{100}\\hlstd{,}\\hlkwc{mean}\\hlstd{=}\\hlnum{10.00}\\hlstd{,}\\hlkwc{sd}\\hlstd{=}\\hlnum{1.50}\\hlstd{)}Connect3END Connect3BEGIN \\hlstd{treatment}\\hlkwb{<-}\\hlkwd{rep}\\hlstd{(}\\hlkwd{c}\\hlstd{(}\\hlstr{'Yes'}\\hlstd{,}\\hlstr{'No'}\\hlstd{),}\\hlkwc{times}\\hlstd{=}\\hlnum{50}\\hlstd{)}Connect3END Connect3BEGIN \\hlstd{race}\\hlkwb{<-}\\hlkwd{rep}\\hlstd{(}\\hlkwd{c}\\hlstd{(}\\hlstr{\"Hispanic\"}\\hlstd{,}\\hlstr{\"White\"}\\hlstd{,}\\hlstr{\"Black\"}\\hlstd{,}\\hlstr{\"Other\"}\\hlstd{),}\\hlkwc{times}\\hlstd{=}\\hlnum{25}\\hlstd{)}Connect3END Connect3BEGIN \\hlstd{qolScore} \\hlkwb{<-}\\hlkwd{rnorm}\\hlstd{(}\\hlnum{100}\\hlstd{,}\\hlkwc{mean}\\hlstd{=}\\hlnum{70.0}\\hlstd{,}\\hlkwc{sd}\\hlstd{=}\\hlnum{10.0}\\hlstd{)}Connect3END Connect3BEGIN \\hlstd{data}\\hlkwb{<-}\\hlkwd{data.frame}\\hlstd{(}\\hlkwc{StudyID}\\hlstd{=StudyID,}Connect3END Connect3BEGIN                  \\hlkwc{gender}\\hlstd{=gender,}Connect3END Connect3BEGIN                  \\hlkwc{age}\\hlstd{=}\\hlkwd{as.numeric}\\hlstd{(age),}Connect3END Connect3BEGIN                  \\hlkwc{treatment}\\hlstd{=}\\hlkwd{factor}\\hlstd{(treatment,} \\hlkwd{c}\\hlstd{(}\\hlstr{'Yes'}\\hlstd{,}\\hlstr{'No'}\\hlstd{)),}Connect3END Connect3BEGIN                  \\hlkwc{race}\\hlstd{=}\\hlkwd{factor}\\hlstd{(race,} \\hlkwd{c}\\hlstd{(}\\hlstr{\"White\"}\\hlstd{,}\\hlstr{\"Black\"}\\hlstd{,} \\hlstr{\"Hispanic\"}\\hlstd{,}\\hlstr{\"Other\"}\\hlstd{)),}Connect3END Connect3BEGIN                  \\hlkwc{qolScore}\\hlstd{=}\\hlkwd{as.numeric}\\hlstd{(qolScore))}Connect3END Connect3BEGIN \\hlkwd{str}\\hlstd{(data)}Connect3END Connect3BEGIN \\end{alltt}Connect3END Connect3BEGIN \\begin{verbatim}Connect3END Connect3BEGIN ## 'data.frame':\t100 obs. of  6 variables:Connect3END Connect3BEGIN ##  $ StudyID  : int  1 2 3 4 5 6 7 8 9 10 ...Connect3END Connect3BEGIN ##  $ gender   : Factor w/ 2 levels \"Female\",\"Male\": 2 1 2 1 2 1 2 1 2 1 ...Connect3END Connect3BEGIN ##  $ age      : num  9.16 9.65 12.34 10.11 10.19 ...Connect3END Connect3BEGIN ##  $ treatment: Factor w/ 2 levels \"Yes\",\"No\": 1 2 1 2 1 2 1 2 1 2 ...Connect3END Connect3BEGIN ##  $ race     : Factor w/ 4 levels \"White\",\"Black\",..: 3 1 2 4 3 1 2 4 3 1 ...Connect3END Connect3BEGIN ##  $ qolScore : num  62.9 72.6 67.5 66.5 60.5 ...Connect3END Connect3BEGIN \\end{verbatim}Connect3END Connect3BEGIN \\begin{alltt}Connect3END Connect3BEGIN \\hlcom{#Summary Table}Connect3END Connect3BEGIN \\hlkwd{library}\\hlstd{(Hmisc)}Connect3END Connect3BEGIN \\hlstd{Demo}\\hlkwb{<-}\\hlkwd{summary}\\hlstd{(treatment}\\hlopt{~}\\hlstd{age}\\hlopt{+}\\hlstd{gender}\\hlopt{+}\\hlstd{race}\\hlopt{+}\\hlstd{qolScore,}\\hlkwc{method}\\hlstd{=}\\hlstr{'reverse'}\\hlstd{,} \\hlkwc{test}\\hlstd{=T)}Connect3END Connect3BEGIN \\hlstd{Demo}\\hlkwb{<-}\\hlkwd{latex}\\hlstd{(Demo,} \\hlkwc{size}\\hlstd{=}\\hlstr{'small'}\\hlstd{,} \\hlkwc{file}\\hlstd{=}\\hlstr{'Demo.tex'}\\hlstd{,} \\hlkwc{where}\\hlstd{=}\\hlstr{'!h'}\\hlstd{)}Connect3END Connect3BEGIN \\end{alltt}Connect3END Connect3BEGIN \\end{kframe}Connect3END Connect3BEGIN \\end{knitrout}Connect3END Connect3BEGIN \\input{Demo}Connect3END Connect3BEGIN \\section{Figure}Connect3END Connect3BEGIN \\begin{knitrout}Connect3END Connect3BEGIN \\definecolor{shadecolor}{rgb}{0.973, 0.973, 0.973}\\color{fgcolor}\\begin{kframe}Connect3END Connect3BEGIN \\begin{alltt}Connect3END Connect3BEGIN \\hlkwd{hist}\\hlstd{(data}\\hlopt{$}\\hlstd{qolScore,}\\hlkwc{main}\\hlstd{=}\\hlstr{''}\\hlstd{)}Connect3END Connect3BEGIN \\hlkwd{boxplot}\\hlstd{(qolScore} \\hlopt{~} \\hlstd{treatment,} \\hlkwc{data}\\hlstd{=data)}Connect3END Connect3BEGIN \\end{alltt}Connect3END Connect3BEGIN \\end{kframe}Connect3END Connect3BEGIN Connect3END Connect3BEGIN {\\centering \\includegraphics[width=.4\\linewidth]{figure/minimal-plot-1} Connect3END Connect3BEGIN \\includegraphics[width=.4\\linewidth]{figure/minimal-plot-2} Connect3END Connect3BEGIN Connect3END Connect3BEGIN }Connect3END Connect3BEGIN Connect3END Connect3BEGIN Connect3END Connect3BEGIN Connect3END Connect3BEGIN \\end{knitrout}Connect3END Connect3BEGIN \\clearpageConnect3END Connect3BEGIN \\newpageConnect3END Connect3BEGIN Connect3END Connect3BEGIN \\begin{thebibliography}{2}Connect3END Connect3BEGIN Connect3END Connect3BEGIN \\bibitem{knitr 2015}Connect3END Connect3BEGIN Yihui Xie (2015) knitr: A General-Purpose Package for Dynamic Report Generation in R. R package version 1.11.Connect3END Connect3BEGIN Connect3END Connect3BEGIN \\bibitem{Hmisc 2015}Connect3END Connect3BEGIN Frank E Harrell Jr, with contributions from Charles Dupont and many others. (2015). Hmisc: Harrell Miscellaneous. R package version 3.16-0. http://CRAN.R-project.org/package=HmiscConnect3END Connect3BEGIN \\end{thebibliography}Connect3END Connect3BEGIN \\end{document} Connect3END"

$path
[1] "/data/gannet/ripley/R/packages/tests-clang/connect3.Rcheck"

> 
> #Convert a LaTeX file to a Rich Text Format file
> tex<-obj$tex
> path<-obj$path
> name<-'connect3-minimal'
> outputlocation<-gsub('\\\\','/',tempdir())
> write.rtf(tex,path,name,outputlocation)
Warning in file(con, "r") :
  cannot open file '/data/gannet/ripley/R/packages/tests-clang/connect3.Rcheck/Demo.tex': No such file or directory
Error in file(con, "r") : cannot open the connection
Calls: write.rtf -> read.latex -> readLines -> file
Execution halted