Dear Anna,

19.02.2010 08:17, Anna Carter wrote:
> (1) If the dataset contains some variables having all the entries = 0
> and while analysing I want to delete those pericular columns, how do
> acheive this. i.e.

Let's suppose 'df' is your data frame, then:

subset(df, select=which(colSums(df)!=0))

should do the work :)

HTH,
Kimmo

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to