Modern Applied Statistics with S-PLUS pp 19-68 | Cite as

# The S Language

Chapter

## 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.

## Keywords

Dimension Vector Data Frame Character String Matrix Operation Search Path
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

## Preview

Unable to display preview. Download preview PDF.

## References

- 1.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.Google Scholar
- 2.These prompts can be altered: see Section 2.11.Google Scholar
- 3.If the expression consists of a simple name such as x , only, the . Last . value object is not changed.Google Scholar
- 4.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.Google Scholar
- 5.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.Google Scholar
- 6.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.Google Scholar - 7.paste is discussed on page 42.Google Scholar
- 8.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.Google Scholar
- 10.There are further types of possible database which we have never had occasion to use.Google Scholar
- 11.Note that the object name as the argument to get must be given in quotes.Google Scholar
- 12.This example is artificial as there is a function diag that can be used for both purposes.Google Scholar
- 13.Note that the names are singular: it is all too easy to write nrows !Google Scholar
- 14.The use of “list” is unfortunate here since it has nothing to do with S list objects.Google Scholar
- 15.This is one of the few places where the recycling rule is disabled: the replacement must be a scalar or of the correct length.Google Scholar
- 16.if else is discussed on page 114.Google Scholar
- 17.The concept of class is discussed in Section 4.4 but the details are not required to understand the present section.Google Scholar
- 18.There is a bug in both 3.3 and 3.4 which prevents matrix indices being used on an assignment.Google Scholar

## Copyright information

© Springer Science+Business Media New York 1997