CHAPTER5. OBJECTS,GETTINGHELP,FUNCTIONS,SUBSETTING,ATTRIBUTES,ANDLIBRARIES
53
5.8 HmiscAdd-onFunctionLibrary
AH2.9
·
Libraries (calledpackagesinR)containabunchofrelatedfunctionsandall
theironlinehelpfiles;maycontaintestdatasetsalso
·
Shasseverallibrariesbuiltin
·
Usersadding morethanonefunctiontoSusuallyputthefunctionsinan
add-onlibrary
·
Hugenumberofadd-onlibrariesavailable
·
Hmisclibrary:varietyofaddedfunctionsfor
– dataanalysisanddatareduction
– high-levelgraphics
– utilities
– samplesize,power
– convertingSASdatasetstoSdataframes
– imputingmissingdata
– advancedtablemaking
– conversionofSobjectstoL
A
T
E
Xcode
– datamanipulationsuchasrecodingdata
Copying image from pdf to powerpoint - software SDK cloud:C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF in C#.net, ASP.NET MVC, WinForms, WPF
Online C# Tutorial for Creating PDF from Microsoft PowerPoint Presentation
www.rasteredge.com
Copying image from pdf to powerpoint - software SDK cloud:VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to PDF in vb.net, ASP.NET MVC, WinForms, WPF
VB.NET Tutorial for Export PDF file from Microsoft Office PowerPoint
www.rasteredge.com
CHAPTER5. OBJECTS,GETTINGHELP,FUNCTIONS,SUBSETTING,ATTRIBUTES,ANDLIBRARIES
54
·
WindowsS-P
LUS
comeswithHmisclibrarybuiltin
·
Getupdatesfrom
hesweb1.med.virginia.edu/biostat/s/Hmisc.html
which
alsohasalinktoapagetellinghowtoinstallthelibrary
c
·
InstallationonWindows systemsjustinvolvesunzippinga filestoredin a
temporarydiskfileintothecorrectsubdirectoryintheareawhereS-P
LUS
is
installed
·
Librariesare“attached”usingthe
library
functionorthe
File ... . Load
Library
menu
·
HmiscneedstooverrideafewbuiltinSfunctionssoitneedstobeattached
inthesearchlist(whichwillbecoveredlater)beforethesystemfunctions
d
·
ThemainfunctionredefinedbyHmiscisthesubsettingfunctionforfactors,
[.factor
.
[.factor
inHmiscbydefaultwillremoveunusedlevelsfroma
factorvariableiftheresultingsubsetdidnotusethatlevel
e
·
TomakeHmiscautomaticallyavailableeverytimeS-P
LUS
isinvoked,put
thefollowinginthescriptorcommandwindowandrunit:
.First ← ← function(...) ) {
library(Hmisc,T)
invisible()
}
·
.First
isauser-definedfunctionthatisexecutedwhenS-P
LUS
startsfrom
aprojectareawhose
Data
directorycontainsthe
.First
function
·
Ifyoudon’tsetup
.First
orusethe
File ... . Load d Library
menudur-
c
AtpresentnoupdatesareavailableforS-P
LUS
6.
d
Ifusingthe
File
menuchecktheboxmarked“attachedattopofsearchlist.”
e
Forexample,
sex[sex==’female’]
willnotkeepa
level
for
male
s.
software SDK cloud:C# PDF copy, paste image Library: copy, paste, cut PDF images in
project. Visual C# class source code for copying, pasting, cutting image from PDF in Visual Studio .NET framework program. Support
www.rasteredge.com
software SDK cloud:VB.NET PDF copy, paste image library: copy, paste, cut PDF images
to Another in VB.NET. .NET framework PDF editor SDK control for image copying, pasting and cutting from adobe PDF file in VB.NET.
www.rasteredge.com
CHAPTER5. OBJECTS,GETTINGHELP,FUNCTIONS,SUBSETTING,ATTRIBUTES,ANDLIBRARIES
55
ing the sessionyou can makethe functions in thelibrary availableusing
library(Hmisc,T)
inyourprogram
·
OnWindowsplatforms,HmisccomeswithaMicrosoftWindowsHelpfilethat
iseasytonavigate
·
Tonavigatethelibrarytype
help(library=’Hmisc’)
or
library(Hmisc,help=T)
(butnotinR)orclickonthespecialmenucreatedforHmiscthefirsttime
library(Hmisc,T)
isexecutedunderS-P
LUS
.
software SDK cloud:C# PDF File Permission Library: add, remove, update PDF file
Image: Copy, Paste, Cut Image in Page. Link: Edit URL. Choose to offer PDF annotation and content extraction Enable or disable copying and form filling functions.
www.rasteredge.com
software SDK cloud:C# PDF Page Extract Library: copy, paste, cut PDF pages in C#.net
NET application. Online C# source code for extracting, copying and pasting PDF pages in C#.NET console class. Support .NET WinForms
www.rasteredge.com
Chapter6
TurningSOutputintoaL
A
T
E
X
PDF
Report
·
Usedtotypesettextinthebottompaneofthe
Script
windowortextsaved
froma
Report
windowintoareportinAdobeAcrobatPortableDocument
Format(
pdf
)
·
The
Report
windowisslightlypreferredasitiscumulative(hasallthecom-
mands and output for the whole e session
a
and
File ... . Save e as
works
when the
Report
window is active(unlike the bottompaneofthe
Script
window).
·
Tomakeoutputgotothe
Report
window,selectitafternavigatingthe
Options
... Text t Output Routing
menus
·
Ifusinga
Report
windowdonotsaveitasabinary
.srp
reportfile;save
filesasplaintext,i.e.,
.txt
isagoodsuffix
·
S-P
LUS
hasanannoyinghabitofmovingsomecommentlineswhenwriting
tothe
Report
window. WhenthesecommentlinescontaintextforL
A
T
E
Xto
process(seelater)thiscanbearealproblem.
a
Ifyouhavetorunsectionsofcodemorethanoncetosucceed,youwillneedtodeleteunneededinputandoutputfromthe
Report
window.
56
software SDK cloud:VB.NET PDF File Permission Library: add, remove, update PDF file
NET PDF Windows Viewer, C#.NET convert image to PDF Choose to offer PDF annotation and content extraction Enable or disable copying and form filling functions.
www.rasteredge.com
software SDK cloud:C# HTML5 PDF Viewer SDK to view, annotate, create and convert PDF
protect PDF document from editing, printing, copying and commenting Such as Word, Excel, PowerPoint, Tiff, images and other C#.NET: Edit PDF Image in ASP.NET.
www.rasteredge.com
CHAPTER6. TURNINGSOUTPUTINTOAL
A
T
E
X
PDF
REPORT
57
·
Also,itisgoodpracticetobeabletoruntheS-P
LUS
scriptfromscratch.
Runningabatchjobwilldothis,onceyouhaveinteractivelydebuggedthe
script.UsingthecommandsbelowwillalsopreventS-P
LUS
fromreposition-
ingcommentlines.Use
Notepad
tocreateafilecalled
s.bat
inyourproject
areaorinafolderinyoursystemfilepath.
s.bat
shouldcontainthefollowing
commands.
set SHOME=’’c:\Program Files\splus61’’ or wherever r S-Plus s is
set S_PROJ=c:\temp
or wherever project t folder r is
set S_CWD=%S_PROJ%
’’c:\Program Files\splus61\cmd\sqpe’’ ’ < < %1.s > %1.txt t replace e .s s with .ssc c if f desired
ThisisaDOSbatchfilethatwheninvokedwiththeDOSor
Run ... . Command
commandof
s myfile
willrunthescript
myfile.s
(or
myfile.ssc
depending
ontheprefixusedabove)andcreateareportfile
myfile.txt
.Running
sqpe
ratherthantheregular
splus.exe
commandrunsS-P
LUS
withouttheGUI
andmakesitrunfasterwhileusinglessRAM. Ifyoustored
s.bat
onafloppy
diskforuseinthelabyoucanrunitbytypingthecommand
a:\s myfile
or
a:\s \projects\myproj\myfile
,forexample.
·
ButhismethoddoesnotprinttheS-P
LUS
commandsinthe
.txt
file; do
makethathappenputthefollowingcommandatthetopofthescript:
options(echo=T)
·
TheserverreformatsSoutputsuchasthe
.txt
fileintoL
A
T
E
Xcode,running
theL
A
T
E
Xcompilerstoredontheservertocreatea
PostScript
document,
and runningthe
Ghostscript
commandtoconvertthe
Postscript
docu-
mentto
pdf
·
Helpsgreatlywithincorporatinghighqualitygraphicsinareport(tobecov-
eredlater)
·
BasicideaistoliberallysprinkleScomments(
# lines
)inyourscript(
.ssc
)
file which are ignored when S runsbut willappearin the output. . These
commentscontainthepurposeormethodsofanalysis(generallybeforethe
software SDK cloud:C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
remove watermark and save PDF text, image, table, hyperlink Password protected PDF file can be printed to Word source code is available for copying and using
www.rasteredge.com
software SDK cloud:C# PDF File & Page Process Library SDK for C#.net, ASP.NET, MVC
Image: Copy, Paste, Cut Image in Page. Link: Edit URL. Bookmark: Edit RasterEdge XDoc.PDF allows you to easily move PDF document pages Copying and Pasting Pages.
www.rasteredge.com
CHAPTER6. TURNINGSOUTPUTINTOAL
A
T
E
X
PDF
REPORT
58
S commandsthatcarried thisout)andinterpretationofresults(generally
appearingaftertheScodeinthe
.ssc
file).
·
TheservercreatesaL
A
T
E
X
article
styledocument
·
Alwaysrefertothemanydocumentationfilesontheserverformoreinfo
·
WhenyouuploadaplaintextASCIIfilethat doesnothaveasuffixof
.tex
tothebiostatisticsL
A
T
E
Xserver,theserverassumesthat
– Alltextafter
#
compriseL
A
T
E
Xcode,senttoL
A
T
E
Xwithoutchange(except
forthe
#@caption
directiveusedinplotting(later))
ThesearecommentstoSandareignoredbyS
– Yourfiledoes notcontainL
A
T
E
Xpreambleandpostamblematerial;these
areaddedautomaticallybytheserver
– Variouscommands areincertainformats when yourprogramcreates
graphics(later)
– Anytextnotprecededby
#
isassumedtobeeitherScommandsorS
output
Soutputisincludedas-isinthereportusingaL
A
T
E
X
verbatim
environ-
ment
Scommandsareparsedsothat
·<-
isconvertedto
byreplacingitwithamacro
\Gets
usedbythe
S.sty
packagethattheservercallstotypesetScodeneatly
·{ }
areconvertedto
\{ \}
sotheywillbetypesettoprintas
{ }
·
Asmall
~
isreplacedby
software SDK cloud:VB.NET PDF File & Page Process Library SDK for vb.net, ASP.NET
The PDFDocument instance may consist of newly created blank pages or image-only pages from an image source. PDF Pages Extraction, Copying and Pasting.
www.rasteredge.com
software SDK cloud:.NET PDF SDK - Description of All PDF Processing Control Feastures
Create PDF from Excel (xlsx, xls); Create PDF from PowerPoint (pptx, ppt PDF page extraction, copying and pasting allow users to move PDF pages; PDF Image Process
www.rasteredge.com
CHAPTER6. TURNINGSOUTPUTINTOAL
A
T
E
X
PDF
REPORT
59
·
Scommentsafter
#
areprintedinasmallerfontbywrappingthat
textinamacro
\scom{...text...}
;itwouldbeeasytodefinethe
scom
macrototypesetcommentsindifferentfontsorcolors.
·
Linesbeginningwith
#
aresenttoL
A
T
E
Xwiththefollowingchanges
#
symbolremoved
<= >= = < < >
arechangedto
$\leq$ $\geq$ $<$ $ $>$
ifthelinedoesnot
alreadyhavetwo
$
init
·
As L
A
T
E
X’s comment symbol is
%
, any y text that you don’t want to typeset
shouldbeinanScommentline(
# ...
) andthattextshouldbepreceeded
by
%
·
Itisrecommendedthatyouincludetitleanddateinformation
·
Mostreportswillhavesections;homeworkswillhavesequentiallynumbered
problems
·
Forthelatter,useaL
A
T
E
X
enumerate
environmentwitheachproblemstarting
with
\item
(oruse
\section{}
)
6.1 ExampleSOutput
Supposeyousavethefollowingintoafile
test.txt
inyourprojectdirectory.
a
># b
> #c
>#d
> # # e
CHAPTER6. TURNINGSOUTPUTINTOAL
A
T
E
X
PDF
REPORT
60
##f
# This is s an n example report. . Line e 2 2 is
# continued here.
> # # This s should d be e treated as s if f the e > > weren’t there, as
# S-Plus sometimes adds s > > in n the e bottom panel of f a a \texttt{Script}
# window. . Here e we e use e math h mode $x+y$.
x <- - matrix(runif(9), , nrow=3) ) # # create a a matrix
# More text
if(1==2) {
y <- - 3
}
ThetemporaryL
A
T
E
Xcodeproducedbytheserverwouldbe
\documentclass{article}
\usepackage{graphicx}
\usepackage{ccapt2}
\usepackage{S}
% S style macros for typesetting S code
\usepackage[bookmarks,pdfpagemode=UseOutlines]{hyperref}
%For commands s at t the e right of f S-Plus code lines:
\newcommand{\scom}[1]{{\rm\scriptsize \# #1}}
... commands s to o set t up p for r making simple tables s (not t shown) ...
... commands s to o set t up p for r graphics s (not t shown) ) ...
\begin{document}
\begin{Example}
% environment for r S S code
a
\end{Example}
b
c
d
e
\begin{Example}
\scom{f}
\end{Example}
CHAPTER6. TURNINGSOUTPUTINTOAL
A
T
E
X
PDF
REPORT
61
This is s an n example e report. . Line e 2 is
continued here.
This should d be treated d as s if f the e $>$ $ weren’t t there, as
S-Plus sometimes s adds s $>$ in n the e bottom panel of f a a \texttt{Script}
window. Here e we e use e math mode $x+y$.
\begin{Example}
x \Gets matrix(runif(9), nrow=3) ) \scom{create e a a matrix}
\end{Example}
More text
\begin{Example}
if(1==2) \{
y \Gets 3
\}
\end{Example}
\end{document}
Notethatalone
>
wastranslatedtomathmode(
$>$
)Hereisatypicalexample,
startingthetheSoutputfilesavedbytheuser.
#\title{Project 2}
#\author{Jane Q. . Public}
#\date{\today}
% or \date{2Jan01} } for r example
#\maketitle
#\thanks{I neither r gave e nor r received d help on n this project --- - J.Q.P.}
#\begin{enumerate}
#\item
% first problem
#My approach h to o this s problem m involved d ...
x <- - rnorm(1000)
#You can n see a Gaussian n shape in n the e histogram.
#More conclusions.
#\item
% skip second problem
#\item
% third problem
#One can n see that ...
#\end{enumerate}
TheresultingL
A
T
E
Xcodeproducedbytheserverisbelow.
CHAPTER6. TURNINGSOUTPUTINTOAL
A
T
E
X
PDF
REPORT
62
\documentclass{article}
\usepackage{graphicx}
\usepackage{ccapt2}
\usepackage{S}
\usepackage[bookmarks,pdfpagemode=UseOutlines]{hyperref}
%For commands s at t the e right of f S-Plus code lines:
\newcommand{\scom}[1]{{\rm\scriptsize \# #1}}
\newcommand{\btable}[1]{
\begin{table}[!htbp]
\begin{center}
\vspace{1ex}
\begin{tabular}{#1} \hline\hline}
\newcommand{\etable}{
\hline
\end{tabular}
\end{center}
\end{table}}
\newcommand{\fig}[2]{\begin{figure}[htbp!]
\leavevmode
\centerline{\includegraphics{#1.ps}}
\small
\caption{#2}
\label{#1}
\end{figure}}
\newcommand{\fign}[1]{\begin{figure}[htbp!]
\leavevmode
\centerline{\includegraphics{#1.ps}}%
\small\captiondelim{}\caption{}%
\label{#1}
\end{figure}}
\begin{document}
\title{Project 2}
\author{Jane Q. . Public}
Documents you may be interested
Documents you may be interested