Abstract
S is a language for the manipulation of objects. It aims to be both an interactive language (like, for example, a Unix shell language) as well as a complete programming language with some convenient object-oriented features. In this chapter we shall be concerned with the interactive language, and hence certain language constructs used mainly in programming will be postponed to Chapter 4.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
When S writes objects onto an external file in assignment form (using dump) the left-hand side of each top level assignment is always placed in quotes, whether the name is standard or not.
These prompts can be altered: see Section 2.11.
If the expression consists of a simple name such as x , only, the . Last . value object is not changed.
In S-PLUS 3.4 and later an extra argument may be included when subsetting factors, as in f [i , drop=T] , to ensure that the levels are pruned to include only those which occur in the subset. Under the default, drop=F , the levels are not changed.
The result of e1 %/% e2 is floor(e1/e2) if e2!=0 and 0 if e2= 0. The result of e1 %% e2 is e1-floor (e1/e2) *e2 if e2 ! =0 and e1 otherwise (see Knuth, 1968, §1.2.4). Thus %/% and %% always satisfy e1==(e1%/%e2)*e2+e1%%e2.
If the argument to var is an n × p matrix the value is a p × p sample covariance matrix obtained by regarding the rows as sample vectors.
paste is discussed on page 42.
For precise details see page 153. 9 These object files should normally not be manipulated except through S-PLUS, although it is sometimes convenient to transfer them directly to another compatible computer.
There are further types of possible database which we have never had occasion to use.
Note that the object name as the argument to get must be given in quotes.
This example is artificial as there is a function diag that can be used for both purposes.
Note that the names are singular: it is all too easy to write nrows !
The use of “list” is unfortunate here since it has nothing to do with S list objects.
This is one of the few places where the recycling rule is disabled: the replacement must be a scalar or of the correct length.
if else is discussed on page 114.
The concept of class is discussed in Section 4.4 but the details are not required to understand the present section.
There is a bug in both 3.3 and 3.4 which prevents matrix indices being used on an assignment.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 1997 Springer Science+Business Media New York
About this chapter
Cite this chapter
Venables, W.N., Ripley, B.D. (1997). The S Language. In: Modern Applied Statistics with S-PLUS. Statistics and Computing. Springer, New York, NY. https://doi.org/10.1007/978-1-4757-2719-7_2
Download citation
DOI: https://doi.org/10.1007/978-1-4757-2719-7_2
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4757-2721-0
Online ISBN: 978-1-4757-2719-7
eBook Packages: Springer Book Archive