Re: [R] deleting columns from a dataframe where NA is more than 15 percent of the column length

2012-08-06 Thread Faz Jones
4.08768 > 4 14.95139 14.01923 > 5 14.99517 15.91936 > 6 14.46359 14.07573 > 7 15.09702 13.94888 > 8 15.99967 14.97171 > 9 15.51924 15.59981 > > A.K. > > > > > > - Original Message - > From: Faz Jones > To: r-help@r-project.org > Cc: > S

Re: [R] deleting columns from a dataframe where NA is more than 15 percent of the column length

2012-08-06 Thread Faz Jones
Thank you. It works great. Sent from my iPhone On Aug 5, 2012, at 9:08 PM, Jorge I Velez wrote: > Hi Faz, > > Here is one way of doing it where "x" is your data frame: > > x[, colMeans(is.na(x)) <= .15] > > HTH, > Jorge.- > > > On Sun, Aug 5,

[R] deleting columns from a dataframe where NA is more than 15 percent of the column length

2012-08-05 Thread Faz Jones
I have a dataframe of 10 different columns (length of each column is the same). I want to eliminate any column that has 'NA' greater than 15% of the column length. Do i first need to make a function for calculating the percentage of NA for each column and then make another dataframe where i apply t

[R] Creating frequency table using conditions in a for-loop

2012-06-06 Thread Faz Jones
Hi, I have attached a word document to explain the problem i am having creating a for-loop in R with conditions to create a frequency table. I am new to R so any help would be greatly appreciated. Thanks Jones __ R-help@r-project.org mailing list https: