This case won't get correctly interpreted. I doubt it must be to do something with my writing style but I cannot notice what it is. You can run it with R CMD Sweave Test.Rnw; pdflatex Test.tex produces the Test.tex file and then compiling to Test.pdf.
What is causing the running to result into gibberish? Why are the Sweave blocks not properly interpreted?
Test.Rnw causing gibberish
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{Sweave}
\begin{document}
.
\begin{figure}
\centering
\begin{subfigure}[b]{0.55\textwidth}
<<>>=
all.lab <- c("Arr./A", "Sin", "Digox")
all.dat <- c(2274959, 1531001, 2406739)
barplot(all.dat,
names.arg=all.lab,
col="darkblue",
ylab="Average byte size",
xlab="Groups")
grid()
@
%\includepdf{fig1.pdf}
\caption{a}
\label{fig:Ng1}
\end{subfigure}
\begin{subfigure}[b]{0.55\textwidth}
<<>>=
age.lab <- c("Arr. +65", "Arr. [45,65]", "Arr", "Sin", "Sin +33")
age.dat <- c(2274959, 1481397, 773624, 874208, 1087411)
barplot(age.dat,
names.arg=age.lab,
col="darkblue",
ylab="Average byte size",
xlab="Groups")
grid()
@
%\includepdf{fig2.pdf}
\caption{b}
\label{fig:Ng2}
\end{subfigure}
\begin{subfigure}[b]{0.55\textwidth}
%\includepdf{fig3.pdf}
<<>>=
gender.lab <- c("Arr. f", "A m", "Sin f", "Sinu", "Digox f", "Digon m")
gender.dat <- c(1416043, 2448017, 1421385, 537783, 1256545, 1181350)
barplot(gender.dat,
names.arg=gender.lab,
col="darkblue",
ylab="Average byte size",
xlab="Groups")
grid()
@
\caption{c}
\label{fig:Ng2}
\end{subfigure}
\caption{MAIN CAPTION}
\end{figure}
\end{document}







l.56 \end {figure} ! ==> Fatal error occurred, no output PDF file produced! Transcript written on....`
– hhh Nov 23 '16 at 22:10fig=TRUEis not longer a problem, the output is better (there are syntax highlight) and the only wrong (but not a fatal error) is use\usepackage{Sweave}that can be omitted using knitr as well as Sweave. – Fran Sep 30 '18 at 18:11echo=FALSE. – Fran Sep 30 '18 at 18:24