From dmurdoch at pair.com  Wed Feb 25 16:57:32 2004
From: dmurdoch at pair.com (Duncan Murdoch)
Date: Wed Feb 25 16:57:43 2004
Subject: [Rd] aliases (PR#6614)
In-Reply-To: <20040225151407.C36D3EC53@slim.kubism.ku.dk>
References: <20040225151407.C36D3EC53@slim.kubism.ku.dk>
Message-ID: <2qgp305801dre3l84dqthnu4nq43f1meb3@4ax.com>

On Wed, 25 Feb 2004 16:14:07 +0100 (CET), ivo.welch@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


[Rd] aliases (PR#6614)
Duncan Murdoch