I use dlply () with a custom function that averages lm () slopes for data containing some NA values, and I get the error "Error in lm.fit (x, y, offset = offset, singular.ok = singular.ok, ...): 0 (non-NA) "
This error only occurs when dlply is called with two key variables - splitting into one variable works great.
Itโs annoying that I canโt reproduce the error using a simple data set, so I posted the problem data set in my Dropbox.
Here, the code is minimized as little as possible when creating the error:
masterData <- read.csv("http://dl.dropbox.com/u/48901983/SOquestionData.csv", na.strings="#N/A") workingData <- data.frame(sample = masterData$sample, substrate = masterData$substrate, el1 = masterData$elapsedHr1, F1 = masterData$r1 - masterData$rK)
Thanks in advance for your understanding.
source share