From JARauh at web.de  Fri Apr 13 13:21:27 2018
From: JARauh at web.de (Johannes Rauh)
Date: Fri, 13 Apr 2018 13:21:27 +0200
Subject: [Rd] In base R: argument `list` does not accept lists
In-Reply-To: <24e3bce3ef024b3ca921f7c8319b37a6@C119S212VM016.msvyvi.vaha.local>
References: <24e3bce3ef024b3ca921f7c8319b37a6@C119S212VM016.msvyvi.vaha.local>
Message-ID: <trinity-3b077c08-3449-471d-8752-8c56b47800b1-1523618487386@3c-app-webde-bs06>

The function `base::rm` has an argument that is named `list`.  However, if a list is passed as `list` to `rm` (e.g.: `rm(list = list("x", "y"))`), an error is raised: "invalid first argument".

Agreed, the documentation says that `list` should be "a character vector naming objects to be removed."  Still, wouldn't it make sense to allow a list of characters as an argument?

The other alternative to make things consistent would be to rename the argument, but that would break compatibility, of course.

Best
Johannes



[Rd] In base R: argument `list` does not accept lists
Johannes Rauh