[R] Grep functions output

Lívio Cipriano lcmail4lists at gmail.com
Mon Aug 5 16:41:38 CEST 2013


Hi,

I'm writing some R scripts and I would like to grab outputs from R functions 
to control if tests. Example, one function outputs something like "p-vale = 
0.0765" and I want to program the following pseudo code in R

sig = grep pvalue

if (sig > 0.05)
	a()
else
	b()

Should I use the grep function of R (http://stat.ethz.ch/R-manual/R-devel/library/base/html/grep.html
) or is there other easy way to do it?

Regards

Lívio Cipriano



More information about the R-help mailing list