> option()
$echo:
[1] T

$prompt:
[1] "> "

$continue:
[1] "+ "

$width:
[1] 80

$length:
[1] 48

$keep:
[1] "function"

$check:
[1] F

$digits:
[1] 7

$memory:
[1] 5e+07

$object.size:
[1] 5e+06

$audit.size:
[1] 5e+05

$error:
expression(dump.calls())

$show:
[1] T

$compact:
[1] 1e+05

$scrap:
[1] 500

$free:
[1] T

$warn:
[1] 0

$editor:
[1] "ed"

> # file of commands to test core of SQPE
> c("abc","defgh","ijklm")
[1] "abc"   "defgh" "ijklm"
> c(1,3.5,7)
[1] 1.0 3.5 7.0
> #prefix("t.")
> z_c(1,6,7.:12)
> options(width=65)
> seq(7.2,15,.2)
 [1]  7.2  7.4  7.6  7.8  8.0  8.2  8.4  8.6  8.8  9.0  9.2  9.4
[13]  9.6  9.8 10.0 10.2 10.4 10.6 10.8 11.0 11.2 11.4 11.6 11.8
[25] 12.0 12.2 12.4 12.6 12.8 13.0 13.2 13.4 13.6 13.8 14.0 14.2
[37] 14.4 14.6 14.8 15.0
> options(width=80)
> zz_c(TRUE,FALSE,T,F);
> zz
[1] T F T F
> NA;
[1] NA
> LGL;
[1] "logical"
> INT;
[1] "integer"
> REAL;
[1] "numeric"
> CHAR	# built-ins
[1] "character"
> help()
On-line Documentation

USAGE:
       help(name="help", offline=F)
       args(name="help")
ARGUMENTS:
name:     a name or a character  string  giving  the  name  of  a
       function,  operator,  or  other  S  object.   If  omitted,
       documentation on help is given (this documentation).   The
       directories  on  the  current search list are searched for
       documentation.
offline:    if TRUE, the requested documentation is  run  through
       the troff command and sent to an appropriate printer.

       If information is found on name, the documentation will be
       printed.   Documentation on S system functions corresponds
       to the contents of this appendix, possibly updated.

       The function args prints only the title and usage  portion
       of the documentation.

       The offline argument is installation-dependent and must be
       set  up  appropriately  by  the administrator of S on each
       system.  Preformatted versions of the  help  documentation
       may  be  set  up by the administrator in directories named
       .Cat.Help, parallel to the .Help directories.

SEE ALSO:
       attach, prompt.

EXAMPLES:
       help(stem)     # documentation for function stem()
       help("+")      # addition (and other arithmetic)
       help(state)    # state data
       help(AUDIT)    # S audit utility

       args(stem)  # describe arguments for stem
> help("help")	# should be the same thing 
On-line Documentation

USAGE:
       help(name="help", offline=F)
       args(name="help")
ARGUMENTS:
name:     a name or a character  string  giving  the  name  of  a
       function,  operator,  or  other  S  object.   If  omitted,
       documentation on help is given (this documentation).   The
       directories  on  the  current search list are searched for
       documentation.
offline:    if TRUE, the requested documentation is  run  through
       the troff command and sent to an appropriate printer.

       If information is found on name, the documentation will be
       printed.   Documentation on S system functions corresponds
       to the contents of this appendix, possibly updated.

       The function args prints only the title and usage  portion
       of the documentation.

       The offline argument is installation-dependent and must be
       set  up  appropriately  by  the administrator of S on each
       system.  Preformatted versions of the  help  documentation
       may  be  set  up by the administrator in directories named
       .Cat.Help, parallel to the .Help directories.

SEE ALSO:
       attach, prompt.

EXAMPLES:
       help(stem)     # documentation for function stem()
       help("+")      # addition (and other arithmetic)
       help(state)    # state data
       help(AUDIT)    # S audit utility

       args(stem)  # describe arguments for stem
> help("xxxx")	#missing
No documentation available for xxxx
> ls()
[1] "z"  "zz"
> #ls(pos=2)
> search()
[1] "./.Data"             "/usr/s/s/.Functions" "/usr/s/s/.Datasets" 
> ls("z*")
[1] "z"  "zz"
> print(matr_matrix(18.:1,6,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_ts(1:37,start=1950,end=1953,freq=12))
      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_ts(start=1837,end=1840,freq=4,data=13:1.))
      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) cat("i=",i," j=",j,"\n")
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) cat("inner=",i,"\n");+ 	cat("outer=",i,"\n");+ 	}
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",ls())
> sys(c("echo testing","cat tst.data"))
testing
matr 
quarterly 
time.series 
z 
zz 
[1] 0
> newlist_scan("tst.data",character());
> newlist
[1] "matr"        "quarterly"   "time.series" "z"           "zz"         
> if(TRUE)"true OK"
[1] "true OK"
> if(FALSE)"IF is screwed up"
NULL
> if(123.4)"all is well" else "mess"
[1] "all is well"
> rm(newlist)
> rm(list="z")
> 1:20
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
> "Now is the time"
[1] "Now is the time"
> #sink()
> #!cat tst.data
> matr[]_seq(1,35,2);
> print(matr)
     [,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
> as.vector(matr) # the right way to do it
 [1]  1  3  5  7  9 11 13 15 17 19 21 23 25 27 29 31 33 35
> matr[,1]
[1]  1  3  5  7  9 11
> matr[2,]
[1]  3 15 27
> matr[c(T,F,T,F,T,F),]
     [,1] [,2] [,3] 
[1,]    1   13   25
[2,]    5   17   29
[3,]    9   21   33
> matr[-2,2:3]
     [,1] [,2] 
[1,]   13   25
[2,]   17   29
[3,]   19   31
[4,]   21   33
[5,]   23   35
> write(file="sou.tst",c(
+ 	"'This is a test of source file'",
+ 	"1:15"
+ 	))
> source("sou.tst")
> "This is a test of source file"
> 1:15
> "Now back from source"
[1] "Now back from source"
> for(i in ls()){print(i);print(get(i))}
[1] "matr"
     [,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
[1] "quarterly"
      1Q 2Q 3Q 4Q
1837: 13 12 11 10
1838:  9  8  7  6
1839:  5  4  3  2
1840:  1
[1] "time.series"
      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
[1] "zz"
[1] T F T F
> !mkdir temp.data
> attach("temp.data")
> search()
[1] "./.Data"             "temp.data"           "/usr/s/s/.Functions"
[4] "/usr/s/s/.Datasets" 
> attach(pos=1,"sdata") #should fail
Can't open sdata for read/write
Error: Invalid search list
Dumped
> search()
[1] "./.Data"             "temp.data"           "/usr/s/s/.Functions"
[4] "/usr/s/s/.Datasets" 
> detach()
> search()
[1] "./.Data"             "/usr/s/s/.Functions" "/usr/s/s/.Datasets" 
> as.vector(1:15,CHAR)
 [1] "1"  "2"  "3"  "4"  "5"  "6"  "7"  "8"  "9"  "10" "11" "12" "13" "14" "15"
> zzz_cstr(Continue string: "now is the time (should be unlabelled\n )",abcdefg=cstr(qq=matr,r=time.series,comment="unlikely"),
+  yet.another=17.5532)
> zzz
[[1]]:
[1] "now is the time (should be unlabelled\n )"

$abcdefg:
$abcdefg$qq:
     [,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:
      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:
[1] "unlikely"


$yet.another:
[1] 17.5532

> zzz$abcdefg$q
     [,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)
> NA:5
Error in call to ":": Missing value where number needed: NA
Dumped
> c(T,F,NA)	# coerced to integer
[1]  T  F NA
> ls()
[1] "last.dump"   "lll"         "matr"        "qqq"         "quarterly"  
[6] "time.series" "zz"          "zzz"        
> rm(qqq,lll)
> ls()
[1] "last.dump"   "matr"        "quarterly"   "time.series" "zz"         
[6] "zzz"        
> coerce(quarterly,CHAR)
        1Q   2Q   3Q   4Q
1837: "13" "12" "11" "10"
1838: "9"  "8"  "7"  "6" 
1839: "5"  "4"  "3"  "2" 
1840: "1" 
> abcdefg	# missing
Error: Object "abcdefg" not found
> T_3	#error
Error: Illegal to assign to the constant "T"
In addition: Warning messages:
  "T" assigned on the working data but hidden by a version on frame 0
> time.series[3:5]	# should end up vector
[1] 3 4 5
> 3.14159 -> pi.approx
> rm(list=ls())
> !rm data tst.data sou.tst
> !rmdir temp.data
> 13.6u 7.9s 80r 	 /usr/s/cmd/Sqpe
