[R] Deleting multiple variables
A.Robinson at ms.unimelb.edu.au
Tue Sep 23 00:38:02 CEST 2008
M_UC <- M_UC[,-(myvars:myvars)]
On Mon, Sep 22, 2008 at 11:04:34PM +0100, Michael Pearmain wrote:
> Hi All,
> i have searched the web for a simple solution but have been unable to find
> one. Can anyone recommend a neat way of deleting multiple variable?
> I see, i need to use dataframe$VAR<-NULL to get rid of one variable,
> In my situation i need to delete all vars between two points.
> I've used the 'which' function to find these out and have assigned to myvar
>  2 17
> but i can't figure out how i should apply this?
> Should i loop through the values? (Psydo code below?)
> for (x in c(myvars:myvars))
> Any help gratful
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Department of Mathematics and Statistics Tel: +61-3-8344-6410
University of Melbourne, VIC 3010 Australia Fax: +61-3-8344-4599
More information about the R-help