0

I have 2 columns from my data table where, i need to return the mail IDs where the mark is less than 50.

When tried with the below code, getting error that "Multiple columns returned for vector output".

check<-function(R)
{
 s<-list(M)
 if(R > 50) 
 {
 s<-list(M)
 }
 return(s)
}

out<-sapply(R,check);
SMG
  • 9
  • 1
  • 2
    What is R? what is M? Please provide a [minimal reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – nico Mar 10 '16 at 15:39
  • Just guessing: `lapply(R, function(vn) list(DT[vn < 50, M]))` where R are variable names. – Frank Mar 10 '16 at 16:06
  • R M New column 20 abc abc 30 xyz xyz 50 aaa 60 bb 70 ccc if column R<50, only the values corresponding to R in column M needs to be returned as new column. – SMG Mar 11 '16 at 11:51

0 Answers0