From hhamid at gmail.com  Tue Mar 17 06:08:11 2015
From: hhamid at gmail.com (Hamid Bazzaz)
Date: Mon, 16 Mar 2015 22:08:11 -0700
Subject: [Rd] Proposing a change in the base::sink interface for type
	argument
Message-ID: <CAJyqX+D7V0HQDz4mctXOQ8GJr6otE+7x9jgb4raSEOpPskyGxg@mail.gmail.com>

Hi folks,

Here is the current interface:

sink(file=NULL, append=FALSE, type = c("output", "message"), split=FALSE)

However, reading the implementation there is implicit assumption that type
is a single character value:
https://github.com/wch/r-source/blob/trunk/src/library/base/R/sink.R#L23

I'm finding this very confusing as the interface is giving a default value
of a character _vector_ causing the illusion that by default both
output/message will be redirected.

I'm proposing either a change in the interface so it is a single character
(either output or message) or a loop in the implementation on all values in
type so it will actually be considered a vector. Here is an example change
for the former:

https://github.com/hhamid/r-source/commit/d3cad22e1b9beca0a55004d74fc95059c279d770#diff-498a99501a04c6d9a66ee95ad6614734L19

Just wondering what people think and if this makes sense.

Thanks a lot,
Hamid

	[[alternative HTML version deleted]]



[Rd] Proposing a change in the base::sink interface for type argument
Hamid Bazzaz