CHAPTER3. INTRODUCTIONTOS
23
·
Harrell’sS-P
LUS
librarieshavebeenportedtoR
·
R’swebpageis
www.r-project.org
3.5 StartingandUsingS-P
LUS
onWindows
3.5.1 StartingS-P
LUS
AH1.2.2,KO2.2
·
Labcomputers:
Run ... . Program m Files
ordesktopicon;mayhavetoput
Sdataobjectsinapublicarea
a
·
Onyourowncomputer: makeadesktopshortcutorbettermakeaproject
directoryandmakeashortcutto
splus.exe
fromthatprojectarea
·
IfyouputashortcuttoS-P
LUS
fromyourprojectarea,carefullyfollowsteps
inA&H1.2.2formodifyingtheshortcutpropertiestopointtotheprojectarea
forstoringdataandscriptsinsteadofusingthecentralsystemarea
3.5.2 CommandWindow
·
Goodforinitiallearning-resultsappearunderyourcommand
·
Use
and
keystoreplaypreviouslyenteredcommands
·
Use
End
keytogotoendofline,
Home
keytogotostartofline
·
ToexitS-P
LUS
enterthecommand
q()
oruse
File ... . Exit
a
Withalittleworkyoucankeeptheseonyour
ITC Home Directory
oronafloppyorZipdisk.
How to convert pdf to powerpoint in - Library SDK class: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
How to convert pdf to powerpoint in - Library SDK class: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
CHAPTER3. INTRODUCTIONTOS
24
3.5.3 ScriptWindow
KO2.16,AH1.5,UG8
·
Recommendedwhenthetaskinvolvesmorethanafewcommands
·
Scripteditorhasnicefeatures
·
Canfit
F10
to submitallcommandsin script editorwindow(ifnonehigh-
lighted)orjustthehighlightedones
·
Dependingonsystemoptionsettings,outputfromthosecommandswillbe
atthebottomofthescriptwindow
·
Canuseasystemoptiontodivertoutputtoacumulative
Report Window
·
Clickonthescripteditorwindowthendo
File ... . Save
tosaveyourscript
inalogicalplace(whichmaybeafloppydisk);bydefaultitwillhaveasuffix
of
.ssc
Library SDK class:Online Convert PowerPoint to PDF file. Best free online export
Download Free Trial. Convert a PPTX/PPT File to PDF. Then just wait until the conversion from Powerpoint to PDF is complete and download the file.
www.rasteredge.com
Library SDK class:C# PDF Convert to Jpeg SDK: Convert PDF to JPEG images in C#.net
C# PDF - Convert PDF to JPEG in C#.NET. C#.NET PDF to JPEG Converting & Conversion Control. Convert PDF to JPEG Using C#.NET. Add necessary references:
www.rasteredge.com
Chapter4
SLanguage
KO3,AH1.4,UG9,PG1
4.1 GeneralRules
KO1.3
·
Promptforcommandsincommandwindow:
>
·
Continuationpromptwhencommandincomplete:
+
·
Neitheroftheseevertypedbyuser
·
Commandcanbeanylength
·
Ifyouwanttobreakalongcommandintomultiplelinesforreadability,make
sureS-P
LUS
knowsthatmoreistocomebymakingthecurrentlineincom-
plete
– Example:endthelinewithoneofthethreecharacters
({,
·
Multiplecommandsmayappearononelineifseparatedby
;
25
Library SDK class:VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.
Convert PDF to Image; Convert Word to PDF; Convert Excel to PDF; Convert PowerPoint to PDF; Convert Image to PDF; Convert Jpeg to PDF;
www.rasteredge.com
Library SDK class:VB.NET PDF Convert to HTML SDK: Convert PDF to html files in vb.
Convert PDF to HTML. |. Home ›› XDoc.PDF ›› VB.NET PDF: PDF to HTML. Convert PDF to HTML in VB.NET Demo Code. Add necessary references:
www.rasteredge.com
CHAPTER4. SLANGUAGE
26
·
Textafter
#
consideredcommentandignored
·
Spacesandtabsincommandsareignoredexceptwheninquotes
·
Doesn’tmatterifusesingleordoublequotesaslongas
– youusethesametypeofquotetocloseasyouusedtoopen
– noquoteofsametypewithinastringbeingquoted(inthatcasequote
withtheunusedcharacter)
·
On Windowssystems (butnotLinux/UNIX), file namesinquotes are not
case-sensitive
·
Indentmostcontinuationlinesforreadability
·
Inthe
Command Window
youcanusethe
Home
and
End
keystomovetothe
startorendofalinetomakecorrections.Youcansubmitthecommandfor
executionbyhitting
Enter
withoutmovingthepointertotheendoftheline.
·
Use
and
keys to replaypreviouslyentered commands; ; thesemay y be
modifiedandthensubmitted
·
Usethe
Command History
windowtoresubmitblocksoflinesatonetime
4.2 TypesofBasicDatainS
·
numeric
– integer
– floatingpoint
Library SDK class:C# powerpoint - Convert PowerPoint to PDF in C#.NET
C# PowerPoint - Convert PowerPoint to PDF in C#.NET. C# Demo: Convert PowerPoint to PDF Document. Add references: RasterEdge.Imaging.Basic.dll.
www.rasteredge.com
Library SDK class:C# PDF Convert to HTML SDK: Convert PDF to html files in C#.net
Convert PDF to HTML. |. C#.NET PDF SDK - Convert PDF to HTML in C#.NET. How to Use C# .NET XDoc.PDF SDK to Convert PDF to HTML Webpage in C# .NET Program.
www.rasteredge.com
CHAPTER4. SLANGUAGE
27
default:doubleprecision—15sig.digits
singleprecision—7digitsofprecision
a
·
characterstring
·
logical
·
list:collectionofseveralobjectsofanytypes
·
function
4.3 SAsaCalculator:ArithmeticExpressions
·
Tryexamplessuchasthefollowing
17
# nothing g to do o but t print t 17
17/2
# division
1+1
# evaluated left to o right
1+2*3+10
# multiplication (*) takes priority over addition
1+2^3
# exponentiation (2 2 to the e 3rd power) ) done first
1+2^3*7
# exponentiation, , then multiplication, then addition
sqrt(4)
# square e root function
1+2*sqrt(9*9) # everything g inside e () ) finished first, , then sqrt, *, , +
3+
# S S will wait for more
4
# 7
·
NotethatwhenyousubmitacommandtoSthatisnotinside
{ }
theresult
ofthecommandwillbeprintedautomatically
·
Use
( )
togroupexpressionssothatorderofevaluationisobvious
2*(3+4)
2*(3+4)^2
a
SingleprecisionisnotavailableinR.
Library SDK class:VB.NET PDF Convert to Word SDK: Convert PDF to Word library in vb.
VB.NET PDF - Convert PDF to MS Office Word in VB.NET. VB.NET Tutorial for How to Convert PDF to Word (.docx) Document in VB.NET. Best
www.rasteredge.com
Library SDK class:VB.NET PDF Convert to Tiff SDK: Convert PDF to tiff images in vb.
VB.NET PDF - Convert PDF to TIFF Using VB in VB.NET. Free VB.NET Guide to Render and Convert PDF Document to TIFF in Visual Basic Class.
www.rasteredge.com
CHAPTER4. SLANGUAGE
28
4.4 AssignmentOperator
·
UsedtocreateavariableorotherSobject
·
Variablenamesmaycontainthesymbols
a-z,A-Z,0-9
and
.
butmaynot
startwithanumber
AH2.1
– Theymaynotcontaintheunderscorecharacterorablank
– Whenimportingdatacontainingillegalfieldnames,Swilloftenconvert
thesetolegalSnamesbutit’sbesttochangethesenamestolegalS
namesyourselfduringtheimport
·
Namesarecase-sensitive
·
Recommendedthatyousurroundtheassignmentoperator(
<-
)byspaces
·
Examples:
x ← ← 4
x
# prints value e of f x, , 4
sqrt(x)-3/2
x ← ← x*2
x
1/x
x-1
y ← ← (x+11*2)/2
y
description ← ← ’This analysis s is s revealing’
description
·
Youcanusethecommand
objects()
or
ls()
tolistnamesofvariablesyou
havecreated
CHAPTER4. SLANGUAGE
29
4.5 TwoFrequentlyUsedFunctions
·
Type
print(expression)
or
print(variablename)
toprinttheresultof
expression
orcontentsof
variablename
– Thisisonlynecessaryifyouwanttocontrolformattingofprintingorare
printingfromwithinafunctionorotherexpressionenclosedby
{ }
·
Type
rm(x), remove(’x’), rm(x,y), , remove(c(’x’,’y’))
toremoveob-
ject
x
orobjects
x
and
y
fromstorage
4.6 MakingVectors
AH2.4
·
TheSfunctionnamed
c
combineselementsintoavector
z ← ← c(’cat’,’dog’) ) # # character string g vector
z
# note [1] ] in output t - - refers to element t 1
c(description, description)
c(1,x)
c(1,x)*2
# arithmetic on n vector does same thing many times
2*c(1,x)
c(1,2,7)
x ← ← c(1,2,7)
length(x)
# returns s number r of f scalar r elements
x/2
c(c(1,4),c(2,5))
·
Whenthevaluesarefromasystematicsequenceyoucansavecoding
rep(2.1, 30)
rep(’garbage’,5)
rep(c(1,3),2)
1:10
# generates a a sequence with increment 1.0
10:1
# decrement 1
seq(1,10)
# same thing
seq(1,10,1)
# same thing
seq(1,10,by=1)
# same thing
seq(1,10,by=2)
# increments by y 2 2 but not to o exceed d 10
seq(1,10,by=-2)
# illegal l increment
seq(5,1)
CHAPTER4. SLANGUAGE
30
seq(5,1,by=-1)
4.7 LogicalValues
·
Valuesof
TRUE
or
FALSE
(abbreviated
T
,
F
)
·
Treat
TRUE
like1,
FALSE
like0
·
Logicalnegationoperator:
!
x ← ← T
# or r TRUE
x
y ← ← !x
y
2 < < 3
2 > > 3
!(2 > 3)
# watch out on n some systems: ! ! as s first character
# can n mean ’send d rest of f line to operating system’
# to o be e safe can do o (!(2 > > 3))
·
Logicalunion(or),intersection(and):
| &
F | | F
T | | F
T & & F
T & & T
2 > > 3 | | 5 5 > > 3
# | | evaluated last
(2>3)|(5>3)
# same thing
x ← ← 11
x > > 6
x ← ← c(5,11,22)
x > > 6
(1:10) < < 5
·
Tocomputea
TRUE,FALSE
onthebasisofanequalityuse
==
x ← ← 6
x==6
x==7
CHAPTER4. SLANGUAGE
31
!(x==7)
x ← ← c(1,6,11)
x==6
4.8 MissingValues
KO4.3
·
Amissingnumericorcharactervaluemaybeginasablankinaspreadsheet
·
SymbolformissingnumericvalueinS:
NA
x ← ← NA
x
x ← ← c(1,2,NA,4)
x
sqrt(x)
sqrt(-1)
·
Tosensethatavalueismissingneveruse
==
,usethe
is.na
function:
is.na(x)
x.present ← !is.na(x)
x.present
·
UnlikeSAS,Sdeterminesinequalitiescorrectlywhen
NA
spresent
x < < 2
x==2
F | | NA
T | | NA
F & & NA
T & & NA
·
Logicalvalueswillbeusedlaterfordecidingwhichobservationsqualifyto
beanalyzed
CHAPTER4. SLANGUAGE
32
4.9 Summary:SCheatsheet
CompiledbyBarryW.Brown
b
DepartmentofBiomathematics
UniversityofTexasM.D.AndersonCancerCenter
Houston,TX77030
bwb@mdaali.cancer.utexas.edu
4.9.1 SExpressions
Literals
number
1 1.1 1.1e10
string
’string’ or "string"
name
comment
# string.
function (formals) expr r function(args){defn}
Calls
expr infix x expr
expr %anything% expr
unary expr
expr ( arglist )
expr [ arglist ]
expr [[ arglist ]]
expr $ fname
Assignment
expr <- expr
expr_expr
expr -> expr
Conditional
if ( expr r ) ) expr
if ( expr r ) ) expr else expr
b
ModifiedslightlybyFEHarrell
Documents you may be interested
Documents you may be interested