Java Mailing List Archive

http://www.r-help.com/

Home » R Help for Statistical Computing »

[R] argument is of length zero

Dan Joo

2010-03-11

Replies: Find Java Web Hosting

Author LoginPost Reply
I am new to R, so I beg your indulgence.
> a='hello world'
> if (grep('hellow',a)) {
print("wow")
} else {
print("wow2")
  }
Error in if (grep("hellow", a)) { : argument is of length zero

What is the proper syntax to ensure that "wow2" gets printed?

Thank you for your help!

Dan

 [[alternative HTML version deleted]]

______________________________________________
R-help@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.