Running S OLD ...
> option
echo = 2  macsize = 10000  dump = 20
width = 80  length = 56  space = 2
max = 1000000  sourcexit = F
> # file of commands to test core of S Version 3
> c("abc","defgh","ijklm")
      "abc"    "defgh"  "ijklm"
> c(1,3.5,7)
      1.0  3.5  7.0
> prefix("t.")
> z_c(1,6,7.:12)
> options width=65
> seq(7.2,15,.2)
        7.2   7.4   7.6   7.8   8.0   8.2   8.4   8.6   8.8   9.0
[11]    9.2   9.4   9.6   9.8  10.0  10.2  10.4  10.6  10.8  11.0
[21]   11.2  11.4  11.6  11.8  12.0  12.2  12.4  12.6  12.8  13.0
[31]   13.2  13.4  13.6  13.8  14.0  14.2  14.4  14.6  14.8  15.0
> options width=80
> zz_c(TRUE,FALSE,T,F);zz

      T  F  T  F
> print(NA,LGL,INT,REAL,CHAR)	# built-ins
      NA
       1
       2
       3
       5
> help

help call: On-line Documentation

help("name")    # information about functions
help(macro="name")    # information about macros
help(dataset="name")    # information about datasets

call("name")   # just give title and argument names
call(macro="name")

ARGUMENTS:
name:  character string, giving the name of a function, operator, macro, or
       dataset. If omitted, documentation on "help" is given (this
       documentation).

If information is found on `name', the documentation will be printed. This is
the same documentation as in the S manual.

An optional argument `width' can be given to specify the maximum width of
printed lines. Default is the smaller of 80 and the value of `width' as set in
the `options' function.

The function `call' prints only the title and usage for a function or macro.

EXAMPLES:
        help("cstr") # documentation for function cstr
        help("+") #documentation on addition (and other arithmetic)

        help(macro="row")    # ?row documentation
        help(dataset="longley")    # Longley dataset info

        call("stem")  # describe arguments for stem
> help("help")	# should be the same thing

help call: On-line Documentation

help("name")    # information about functions
help(macro="name")    # information about macros
help(dataset="name")    # information about datasets

call("name")   # just give title and argument names
call(macro="name")

ARGUMENTS:
name:  character string, giving the name of a function, operator, macro, or
       dataset. If omitted, documentation on "help" is given (this
       documentation).

If information is found on `name', the documentation will be printed. This is
the same documentation as in the S manual.

An optional argument `width' can be given to specify the maximum width of
printed lines. Default is the smaller of 80 and the value of `width' as set in
the `options' function.

The function `call' prints only the title and usage for a function or macro.

EXAMPLES:
        help("cstr") # documentation for function cstr
        help("+") #documentation on addition (and other arithmetic)

        help(macro="row")    # ?row documentation
        help(dataset="longley")    # Longley dataset info

        call("stem")  # describe arguments for stem
> help "xxxx"	#missing
No information on xxxx
> list
      "z"   "zz"
> list pos=2
NULL
> search(1);search;search(3);search(4)
      "/usr/s/s"       "/usr/s/slocal"
      "swork"          "sdata"          "/usr/s/s/data"
       "TRUE"   "FALSE"  "CHAR"   "REAL"   "INT"    "LGL"    "F"      "T"
[ 9]   "NA"     "NULL"
> list("z*")
      "z"   "zz"
> print(matrix_cstr(Dim=c(6,3),Data=18.:1,stype=21))
Warning: matrix is a function name. Use    print(matrix)    to print this dataset

Array:
6 by 3

       [,1]  [,2]  [,3]
[1,]     18    12     6
[2,]     17    11     5
[3,]     16    10     4
[4,]     15     9     3
[5,]     14     8     2
[6,]     13     7     1

> print(time.series_cstr(Tsp=c(1950,1953.,12),Data=1:37,stype=20))

Time-series:
start: 1950 1   end: 1953 1   Monthly

        Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
 1950     1    2    3    4    5    6    7    8    9   10   11   12
 1951    13   14   15   16   17   18   19   20   21   22   23   24
 1952    25   26   27   28   29   30   31   32   33   34   35   36
 1953    37

> print(quarterly_cstr(Tsp=c(1837,1840.,4),Data=13:1.,stype=20))

Time-series:
start: 1837 1   end: 1840 1   Quarterly

         1Q   2Q   3Q   4Q
 1837    13   12   11   10
 1838     9    8    7    6
 1839     5    4    3    2
 1840     1

> for(i in 1:5)for(j in 2:1) print(i=i,j=j)
i
       1
j
       2
i
       1
j
       1
i
       2
j
       2
i
       2
j
       1
i
       3
j
       2
i
       3
j
       1
i
       4
j
       2
i
       4
j
       1
i
       5
j
       2
i
       5
j
       1
> for(i in 1:3){
+ 	for(i in 2:1) print(inner=i)
+ 	print(outer=i)
+ 	}
inner
       2
inner
       1
outer
       1
inner
       2
inner
       1
outer
       2
inner
       2
inner
       1
outer
       3
> write(16:53)	# should be named "data"
> !cat data
 16  17  18  19  20
 21  22  23  24  25
 26  27  28  29  30
 31  32  33  34  35
 36  37  38  39  40
 41  42  43  44  45
 46  47  48  49  50
 51  52  53
> write(file="tst.data",list())
> sys(c("echo testing","cat tst.data"))
testing
 matrix
 quarterly
 time.series
 z
 zz
> newlist_read("tst.data");newlist
Read 5 items

      "matrix"       "quarterly"    "time.series"  "z"            "zz"
> if(TRUE)"true OK"
      "true OK"
> if(FALSE)"IF is screwed up"
> if(123.4)"all is well" else "mess"
      "all is well"
> rm newlist,print=T
t.newlist
> rm list="z"
> sink("tst.data")	# going to overwrite
> 1:20
> "Now is the time"
> sink()
> !cat tst.data
        1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18
[19]   19  20
      "Now is the time"
> matrix$Data_seq(1,35,2); print(matrix)

Array:
6 by 3

       [,1]  [,2]  [,3]
[1,]      1    13    25
[2,]      3    15    27
[3,]      5    17    29
[4,]      7    19    31
[5,]      9    21    33
[6,]     11    23    35

> (matrix)$Data
        1   3   5   7   9  11  13  15  17  19  21  23  25  27  29  31  33  35
> matrix$Data	# got it in two ways
        1   3   5   7   9  11  13  15  17  19  21  23  25  27  29  31  33  35
> matrix[,1]
       1   3   5   7   9  11
> matrix[2,]
       3  15  27
> matrix[c(T,F,T,F,T,F),]

Array:
3 by 3

       [,1]  [,2]  [,3]
[1,]      1    13    25
[2,]      5    17    29
[3,]      9    21    33

> matrix[-2,2:3]

Array:
5 by 2

       [,1]  [,2]
[1,]     13    25
[2,]     17    29
[3,]     19    31
[4,]     21    33
[5,]     23    35

> write(file="sou.test",c(
+ 	"'This is a test of source file'",
+ 	"1:15"
+ 	))
> source("sou.test")
      "This is a test of source file"
        1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
> "Now back from source"
      "Now back from source"
> chapter "abcdef"	#generates an error -- will it abort source
abcdef is not a chapter
Error in chapter
Dumped
> for(i in list())print(i,get(i))
      "matrix"

Array:
6 by 3

       [,1]  [,2]  [,3]
[1,]      1    13    25
[2,]      3    15    27
[3,]      5    17    29
[4,]      7    19    31
[5,]      9    21    33
[6,]     11    23    35

      "quarterly"

Time-series:
start: 1837 1   end: 1840 1   Quarterly

         1Q   2Q   3Q   4Q
 1837    13   12   11   10
 1838     9    8    7    6
 1839     5    4    3    2
 1840     1

      "time.series"

Time-series:
start: 1950 1   end: 1953 1   Monthly

        Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
 1950     1    2    3    4    5    6    7    8    9   10   11   12
 1951    13   14   15   16   17   18   19   20   21   22   23   24
 1952    25   26   27   28   29   30   31   32   33   34   35   36
 1953    37

      "zz"

      T  F  T  F
> attach "swork"	# puts it on end
> search
      "swork"          "sdata"          "/usr/s/s/data"  "swork"
> attach pos=1,"sdata"
> search
      "sdata"          "swork"          "sdata"          "/usr/s/s/data"
[5]   "swork"
> detach
> search
      "sdata"          "swork"          "sdata"          "/usr/s/s/data"
> coerce(1:15,CHAR)
       "1"   "2"   "3"   "4"   "5"   "6"   "7"   "8"   "9"   "10"  "11"  "12"
[13]   "13"  "14"  "15"
> coerce((1:12)%m CHAR,REAL)
         1    2    3    4    5    6    7    8    9   10   11   12
> zzz_cstr("now is the time (should be unlabelled
+  )",abcdefg=cstr(q=matrix,r=time.series,comment="unlikely"),
+  yet.another=17.5532)
> zzz

      "now is the time (should be unlabelled
 )"
 $abcdefg
 $abcdefg$q
Array:
6 by 3

       [,1]  [,2]  [,3]
[1,]      1    13    25
[2,]      3    15    27
[3,]      5    17    29
[4,]      7    19    31
[5,]      9    21    33
[6,]     11    23    35

 $abcdefg$r
Time-series:
start: 1950 1   end: 1953 1   Monthly

        Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
 1950     1    2    3    4    5    6    7    8    9   10   11   12
 1951    13   14   15   16   17   18   19   20   21   22   23   24
 1952    25   26   27   28   29   30   31   32   33   34   35   36
 1953    37

 $abcdefg$comment
      "unlikely"
 $yet.another
      17.5532
> zzz$abcdefg$q

Array:
6 by 3

       [,1]  [,2]  [,3]
[1,]      1    13    25
[2,]      3    15    27
[3,]      5    17    29
[4,]      7    19    31
[5,]      9    21    33
[6,]     11    23    35

> save(qqq=zzz,lll=quarterly)
> list(pos=2)
      "lll"          "matrix"       "qqq"          "quarterly"    "time.series"
[6]   "zz"
> print(prefix("another."))
      "t."
> prefix("t.")
> NA:5
Error: Missing values not allowed
Error in :: argument from
> c(T,F,NA)	# coerced to INT!!
       1   0  NA
> attach "sdata",pos=1
> list
      "zzz"
> rm qqq,lll
Warning: t.qqq not found on database pos = 1
Warning: t.lll not found on database pos = 1
> list
      "zzz"
> attach "swork",pos=1
> coerce(quarterly,CHAR)

Time-series:
start: 1837 1   end: 1840 1   Quarterly

          1Q    2Q    3Q    4Q
 1837   "13"  "12"  "11"  "10"
 1838   "9"   "8"   "7"   "6"
 1839   "5"   "4"   "3"   "2"
 1840   "1"

> abcdefg	# missing
t.abcdefg not found
> T_3	#warning
Warning: T is a built-in name. Use    get("T",pos=1)    to access this dataset
> sink_4	#another warning
Warning: sink is a function name. Use    print(sink)    to print this dataset
> T; $t.T
      T

       3
> function()
Error:  Function function not found
> time.series[3:5]	# should end up vector
       3   4   5
> 3.14159 -> pi
> search
      "swork"          "sdata"          "sdata"          "swork"
[5]   "sdata"          "/usr/s/s/data"
> list
      "T"            "lll"          "matrix"       "pi"           "qqq"
[6]   "quarterly"    "sink"         "time.series"  "zz"
> "Warning from test source file--- working file is messed up"
      "Warning from test source file--- working file is messed up"
> " Should now be returning from source file";"Try `q' and `quit' yourself"
      " Should now be returning from source file"
      "Try `q' and `quit' yourself"
> !rm data tst.data sou.test
3.1u 3.6s 9r 	 /usr/s/cmd/RUN.S
