\batchmode \makeatletter \def\input@path{{/home/rshepard/documents/white-papers/water-chem-anal//}} \makeatother \documentclass[letterpaper,twoside,english,abstract=on]{scrreprt}\usepackage[]{graphicx}\usepackage[]{color} %% maxwidth is the original width if it is less than linewidth %% otherwise use linewidth (to make sure the graphics do not exceed the margin) \makeatletter \def\maxwidth{ % \ifdim\Gin@nat@width>\linewidth \linewidth \else \Gin@nat@width \fi } \makeatother \definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345} \newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}% \newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}% \newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}% \newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}% \newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}% \newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}% \newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}% \newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}% \newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}% \usepackage{framed} \makeatletter \newenvironment{kframe}{% \def\at@end@of@kframe{}% \ifinner\ifhmode% \def\at@end@of@kframe{\end{minipage}}% \begin{minipage}{\columnwidth}% \fi\fi% \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep \colorbox{shadecolor}{##1}\hskip-\fboxsep % There is no \\@totalrightmargin, so: \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}% \MakeFramed {\advance\hsize-\width \@totalleftmargin\z@ \linewidth\hsize \@setminipage}}% {\par\unskip\endMakeFramed% \at@end@of@kframe} \makeatother \definecolor{shadecolor}{rgb}{.97, .97, .97} \definecolor{messagecolor}{rgb}{0, 0, 0} \definecolor{warningcolor}{rgb}{1, 0, 1} \definecolor{errorcolor}{rgb}{1, 0, 0} \newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX \usepackage{alltt} \usepackage{mathpazo} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \makeatletter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands. \pdfpageheight\paperheight \pdfpagewidth\paperwidth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands. \usepackage[natbibapa]{apacite} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. \date{} \usepackage{textcomp,url,multicol} %\setkomafont{sectioning}{\rmfamily} \makeatother \usepackage{babel} \IfFileExists{upquote.sty}{\usepackage{upquote}}{} \begin{document} In 1986 Ward described the status of water quality assessment as \textquotedbl{}data rich and information poor\textquotedbl{} \citep{Ward1986}. The authors addressed the lack of science-based design of monitoring location networks; this situation still applies. They defined water quality monitoring as \textquotedbl{}any effort by a government or private enterprise to obtain an understanding of the physical, chemical, and biological characteristics of water via statistical sampling.\textquotedbl{} Of course, their definition also applies to appropriate statistical analyses of the collected data. The data available for the Carlin site (USGS station number 10321000 are in Appendix A. Many documents on data analysis and statistics use small sample sets to illustrate the points the author wants the reader to learn. Real-world environmental data sets frequently are very large so this document uses 52 variables from the total available from the USGS's web site. The first step in analyzing water chemistry data for CWA compliance is reading it into the analytical software and converting column data types as necessary. \begin{knitrout} \definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe} \begin{alltt} \hlstd{carlin} \hlkwb{<-} \hlkwd{read.csv}\hlstd{(}\hlstr{"./carlin.csv"}\hlstd{,} \hlkwc{header}\hlstd{=T,} \hlkwc{sep}\hlstd{=}\hlstr{","}\hlstd{,}\hlkwc{stringsAsFactors}\hlstd{=F)} \hlstd{carlin}\hlopt{$}\hlstd{sampdate} \hlkwb{<-} \hlkwd{as.Date}\hlstd{(carlin}\hlopt{$}\hlstd{sampdate)} \end{alltt} \end{kframe} \end{knitrout} Next, check that the data are what you expect to see and convert dates from factors. The site ID number is retained for use when examining multiple stations along the Humboldt River for longitudinal changes and other variables that might affect the measured values. \begin{knitrout} \definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe} \begin{alltt} \hlkwd{str}\hlstd{(carlin,} \hlkwc{width}\hlstd{=}\hlnum{60}\hlstd{,} \hlkwc{strict.width}\hlstd{=}\hlstr{'cut'}\hlstd{)} \end{alltt} \begin{verbatim} ## 'data.frame': 208 obs. of 50 variables: ## $ sampdate: Date, format: "1965-10-01" ... ## $ Temp : num NA NA NA NA NA NA NA NA NA NA ... ## $ Dischg : num 98 141 128 122 97 108 384 701 612 541 ... ## $ Turb : int NA NA NA NA NA NA NA NA NA NA ... ## $ SC : int 490 507 564 506 551 506 516 628 470 423 .. ## $ pH : num 8.4 8.3 8.1 8.2 8.5 8.2 7.7 8.1 8 8 ... ## $ ANC : int NA 213 238 212 241 216 201 235 189 172 ... ## $ Alk : int NA NA NA NA NA NA NA NA NA NA ... ## $ Hard : num 150 170 190 170 200 180 160 190 160 140 .. ## $ TDS : int NA NA 359 321 NA NA NA NA 301 NA ... ## $ TSS : int NA NA NA NA NA NA NA NA NA NA ... ## $ DO : num NA NA NA NA NA NA NA NA NA NA ... ## $ HCO3 : int 238 252 290 259 276 263 245 286 231 210 .. ## $ CO3 : int 4 4 NA NA 9 NA NA NA NA NA ... ## $ N.tot : num NA NA NA NA NA NA NA NA NA NA ... ## $ N.org : num NA NA NA NA NA NA NA NA NA NA ... ## $ NH4 : num NA NA NA NA NA NA NA NA NA NA ... ## $ NO3 : num NA NA NA NA NA NA NA NA NA NA ... ## $ NO2 : num NA NA NA NA NA NA NA NA NA NA ... ## $ PO4 : num NA NA NA NA NA NA NA NA NA NA ... ## $ SO4 : num NA NA 37 34 NA NA NA NA 37 NA ... ## $ C : num NA NA NA NA NA NA NA NA NA NA ... ## $ Ca : num 40 50 56 50 58 52 46 51 43 40 ... ## $ Mg : num 12 11 13 11 13 11 11 16 12 10 ... ## $ Na : num 46 42 47 45 48 42 46 61 40 34 ... ## $ K : num NA NA 6.4 6.1 NA NA 8 8.5 6.3 5.4 ... ## $ Cl : num NA NA 16 16 NA NA NA NA 14 NA ... ## $ F : num NA NA 0.5 0.6 NA NA NA NA 0.5 NA ... ## $ Si : num NA NA 40 31 NA NA NA NA 34 NA ... ## $ As : int NA NA NA NA NA NA NA NA NA NA ... ## $ Ba : num NA NA NA NA NA NA NA NA NA NA ... ## $ Be : num NA NA NA NA NA NA NA NA NA NA ... ## $ Cd : int NA NA NA NA NA NA NA NA NA NA ... ## $ Cr : int NA NA NA NA NA NA NA NA NA NA ... ## $ Co : int NA NA NA NA NA NA NA NA NA NA ... ## $ Cu : num NA NA NA NA NA NA NA NA NA NA ... ## $ Fe : num NA NA NA NA NA NA NA NA NA NA ... ## $ Pb : int NA NA NA NA NA NA NA NA NA NA ... ## $ Mn : num NA NA NA NA NA NA NA NA NA NA ... ## $ Mo : num NA NA NA NA NA NA NA NA NA NA ... ## $ Ni : int NA NA NA NA NA NA NA NA NA NA ... ## $ Ag : int NA NA NA NA NA NA NA NA NA NA ... ## $ Sr : int NA NA NA NA NA NA NA NA NA NA ... ## $ V : num NA NA NA NA NA NA NA NA NA NA ... ## $ Zi : num NA NA NA NA NA NA NA NA NA NA ... ## $ Al : int NA NA NA NA NA NA NA NA NA NA ... ## $ Li : num NA NA NA NA NA NA NA NA NA NA ... ## $ Se : int NA NA NA NA NA NA NA NA NA NA ... ## $ CN : num NA NA NA NA NA NA NA NA NA NA ... ## $ Hg : num NA NA NA NA NA NA NA NA NA NA ... \end{verbatim} \end{kframe} \end{knitrout} \end{document}