R-alpha: misc. 0.14

Paul Gilbert (jellis@uottawa.ca)
Wed, 04 Dec 1996 01:13:30 -0400

Date: Wed, 04 Dec 1996 01:13:30 -0400
From: Paul Gilbert <jellis@uottawa.ca>
To: R testers <r-testers@stat.math.ethz.ch>
Subject: R-alpha: misc. 0.14

1/ This is a new problem in 0.14
> old.p <- par()
> par(old.p)
Error in par(args) : parameter "lwd" has the wrong length

2/ This is in 0.14 and was also in 0.13. In S "apply" can distinguish a
function from a value
  mean<-apply(matrix(1:20,10,2),2,mean) # second one gets mixed up
Error: " 5.5 " is not a function

3/ I randomly get Error: invalid left-hand side to assignment in both
v0.13 and v0.14. A program may produce this error and then when executed
immediately again it might work.

4/ There are some Segmentation faults in both  v0.13 and v0.14 (in
addition to cbind). I have one buried deep in a test suite, which seems
to be reproducable, but does not happen if I use browser(). I have not
tracked it down further yet.

> exists("exists")

Therefore I am not. There is a more general problem with exists. I have
had to switch the default value to envir=globalEnv to get the result I
usually need. If this is a design feature I will have to do some
recoding in my programs. The real question I usually want the answer to
is whether a function exists in the search list. I'm not sure how this
is (is to be?) implemented in R, but it will be a problem with
libraries. Also search() to get the search path is not available.

6/ I see that setting a list element to NULL has been fixed in 0.14 so
that the class information is not lost when an element is removed. But
z <- list(a=1:3, b:2:4)
z[["b"]] <- NULL
makes z a list with an element b which is NULL whereas 
z$b <- NULL 
removes b from the structure. For most purposes this probably doesn't
matter but I suspect it is not intentional.

A second difference between $<- and [[<- still causes me more trouble:

> z <- list(a=1:3)
> z[["b"]] <- 2:4
Error: subscript out of bounds
> z$b <- 2:4
so I am still using my own special version of "[[<-". In the long run 
this is not a good thing for me to do because it will eventually result
in other conflicts, so please let me know if this is a design feature
rather than a bug.

7/ There is an error in summary.default when used with a list whose
elements have a class of length greater than one. This was (still is?) a
problem in S too. The easiest fix is a paste near the end:
summary.default ...
		if (any(nas)) c(qq, NA's = sum(nas))
			sumry[i, 2] <- if (is.object(ii)) 
				paste(class(ii), collapse=" ") #class(ii)
			else "-none-"

There is a line in summary.default:
    c(qq, NA's=sum(nas))
which does not seem to be allowable syntax even though it is defined. Is
this correct and what does it do?

8/ Now that there is postscript()and dev.off() is there any way to
dev.ask() to see if some device is active?

9/ Could someone please explain to me the syntax to use when trying to
get a value from a different frame when I am stopped with browser.

10/ I have used sort.list() in a couple of places in my code as in
apply(z,1,sort.list) where z is a matrix. I don't have S or the manuals
available right now and I can't remember exactly what sort.list does.
(It is something like order() but not exactly.) Does anyone have a
sort.list for R or can someone please remind me what it does?

10/ browser works and continues with ^D but it causes the message
   ^syntax error
Does anyone else have this problem? It may be related to the following:

11/ I realize this is not the correct list to ask this question but if
anyone recognizes these problems I sure would appreciate some help. I am
running OpenWindows on Linux-elf. My cmdtools echo command lines (and R
input) even though shelltools and the shell which I use to start openwin
do not. After some time they start echoing to the shell which started
the cmdtool, at which time the cmdtool freezes and never returns. Also,
when a cmdtool is closed all child tools and other child process (eg.
textedit sessions) are also killed. I would like to stop the echo, but
most of all I would like to correct the problem which causes the cmdtool
to freeze and also stop the child windows from being killed when a
window is exited. 

In addition, I get the message
ttysw_sigwinch, can't get tty process group: Not a typewriter
whenever I move or resize a window.

Despite all of these problem, R in Linux seems to be very fast. I have a
very large part of my test suite working (skipping complex number stuff)
and the speed on a slow 16M Pentium seems to compare favourably to S in
Solaris on a Sparc10 with lots more memory.

Paul Gilbert

r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch