Skip to content
Prev 273860 / 398506 Next

sapply(pred,cor,y=resp)

Hi,

It is probably more confusing with several steps combined, but you are
correct that it is because there are NAs.  It is fairly common for R
functions to return NA if there are any NA values unless you
explicitly set an argument on what to do with missing values.  A quick
look at ?cor clearly shows that there is such an argument with several
options.  Try adding ',  use = "pairwise.complete.obs"  ' to your
sapply call.

Hope that helps,

Josh
On Sun, Oct 9, 2011 at 12:47 AM, William Claster <dmfall2010 at yahoo.com> wrote:
In the future, please post in plain text, not HTML (as the posting
guide requests).