[Rd] aliases (PR#6614)

Duncan Murdoch dmurdoch at pair.com
Wed Feb 25 16:57:32 MET 2004


On Wed, 25 Feb 2004 16:14:07 +0100 (CET), ivo.welch at yale.edu wrote :

>Full_Name: ivo welch
>Version: 1.8.1
>OS: linux
>Submission from: (NULL) (130.132.33.212)
>
>
>
>please define aliases for the 5 essential data set operations
>
>  delete row
>  insert row
>  delete column
>  insert column
>  rename column
>
>these are too difficult for novices as-is now, and the cost for doing this for
>you would be very low.  if need be, define hints only, such as
>
>dataset.del.row() <- function
>   cat("to delete a row, do this...");

Would it be enough for 'help.search("delete row")' to go to the
help('[') page?  That could be very easily done.  That man page could
include a reference to the appropriate sections of the R-intro manual
for a more tutorial approach.

The problem with adding functions is that they would be limited in
their range of application, and it would be hard for beginners to
discover them anyway.

For example, the obvious definition of delete.column would be 

 delete.column <- function(x, col) x[,-col]

which would work for data.frames and matrices, but not for vectors, or
for arrays of higher dimensions.

I think enhancing the data editor to allow it to insert and delete
rows and columns would be a better approach than defining a whole list
of functions.  It can already rename and append rows and columns.

Duncan Murdoch



More information about the R-devel mailing list