我正在尝试通过运行:
将tex文档转换为pdf这是文件:
\documentclass[letter,10pt]{article}
\usepackage{amsmath}
\usepackage{amscd}
\usepackage{ifthen}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage[top=1.0in, bottom=1.0in, left=1.0in, right=1.0in]{geometry}
\usepackage{float}
\usepackage{rotating}
\usepackage{longtable}
\usepackage{tabularx}
<<LBY, echo=FALSE>>=
library(zoo)
library(scales)
library(ggplot2)
library(xtable)
library(forecast)
library(data.table)
library(xtable)
library(RODBC)
library(chron)
library(xts)
library(grid)
library(ggthemes)
@
\begin{document}
\SweaveOpts{concordance=TRUE}
\title{Servera Lite Implementation \\ Pre/Post Resource And Transaction Analysis}
\author{Capacity Planning Engineers}
\maketitle
\pagebreak
\tableofcontents
\pagebreak
\section{Servera LITE}
Split Login and DB write operation, reduce customer impact and increase capacity by adding 2 additional Lpars for customer login only.
This report will hightlight Resource utilization, transaction, response times during pre and post implementation of the project. For detail and more information please visit:
\url{http://cigpcapacity.jpmchase.net}
\pagebreak
\section{Servera DB}
\subsection{% CPU Utilization}
<<echo=FALSE>>=
sql<-c("SELECT T.LPAR, T.\"DATE\", T.\"usr\", T.\"sys\" , T.\"pc\" FROM db_table T WHERE T.\"LPAR\" in ('servera', 'serverb') and T.\"DATE\">SYSDATE-30")
tryCatch({
ch=odbcConnect("perfcap",pwd = "chase101")
res<-sqlQuery(ch,sql)
},error = function(e) {
print(odbcGetErrMsg(ch))
})
odbcClose(ch)
x<-res
###Servera WEEKLY CPU PROCESSING
x$Day<-weekdays(x$DATE)
x$cpu<-x$usr+x$sys
x<-x[, c("LPAR", "DATE", "cpu", "pc")]
colnames(x)<-c("server", "date", "cpu", "pc")
x$time<-format(x$date, "%H:%M:%S")
x$time<-times(x$time)
apply.periodly <- function (x, FUN, period, k=1, ...)
{
if (!require("xts")) {
stop("Need 'xts'")
}
ep <- endpoints(x, on=period, k=k)
period.apply(x, ep, FUN, ...)
}
###peak cpu for 180 minutes interval for weekly data
mydata.xts <- xts(x$cpu, order.by = x$date)
mydata.180M <- apply.periodly(x = mydata.xts, FUN = max, period = "minutes", k = 60)
new_df<-data.frame(date=index(mydata.180M), coredata(mydata.180M))
colnames(new_df)<-c("date", "cpu")
weekly_cpu<-new_df
weekly_cpu$date<-format(round(weekly_cpu$date, units="hours"), format="%Y-%m-%d %H:%M:%S")
weekly_cpu$date<-as.POSIXct(weekly_cpu$date, format="%Y-%m-%d %H:%M:%S")
weekly_cpu$time1<-format(weekly_cpu$date, "%H:%M:%S")
weekly_cpu$time1<-times(weekly_cpu$time1)
weekly_cpu<-subset(weekly_cpu, time1 > times(c("07:00:00")) & time1 < times(c("18:00:00")))
weekly_cpu<-weekly_cpu[,c(1,2)]
weekly_cpu$day<-weekdays(weekly_cpu$date)
weekly_cpu<-subset(weekly_cpu, day %in% c("Monday","Tuesday","Wednesday","Thursday","Friday"))
@
\begin{center}
<<fig=TRUE,echo=FALSE, width=15, height=10>>=
print(ggplot()+geom_point(data=subset(weekly_cpu, date< as.POSIXct(c("2014-05-09 23:59:59"))),aes(date, cpu), size=0.5, colour='blue') +
geom_point(data=subset(weekly_cpu, date> as.POSIXct(c("2014-05-09 23:59:59"))),aes(date, cpu), size=0.7, colour='red')+
theme_bw()+ylim(0,100)+ylab("% CPU")+xlab("Date")+ggtitle(paste("Servera Database","\n","% CPU Utilization"))+
geom_smooth(data=subset(weekly_cpu, date<as.POSIXct(c("2014-05-09 23:59:59"))),aes(date,cpu),method="loess", size=1.5, colour="blue", se=T)+
geom_segment(aes(x = as.POSIXct(c("2014-05-12 12:00:00")), y = 80, xend = as.POSIXct(c("2014-05-12 12:00:00")), yend = 65), colour="red",size=1,arrow = arrow(length = unit(0.3, "cm")))+
annotate("text", x=as.POSIXct(c("2014-05-10 00:00:00")),y=90,label="Servera Lite went live",size=3,colour="red")+
theme(legend.position = "none")+theme_igray())
@
\end{center}
\end{document}
pdflatex test.tex
我收到了这个错误:
[2] ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ae\t1aett.fd") [3])
Runaway argument?
{\par \par \begin {center} \includegraphics {test-003} \par \end {cen\ETC.
! File ended while scanning use of \@xdblarg.
<inserted text>
\par
我对乳胶非常新。任何想法我可能在那里做什么。我确认所有括号都匹配。