I have a dataset where I have filtered out the NA values and plan to fit a general linear model to predict stuff. However when I do this:
model<-bayesglm(total_score ~ ., data=traint)
I get the following error:
Error in lm.fit(x = x.star[good.star, , drop = FALSE] * w.star, y = z.star * :
NA/NaN/Inf in 'y'
Based on a previous post: lm() NA/NaN/Inf error , I am trying to eliminate the finite values of the dataset....
Having checked for such finite values with:
summary(timesData)
output too long to show
I can't find any symbol that tells me how to subset the data in such a way that I can filter out these finite values....
My attempt at doing this anyway is as follows:
train<-subset(timesData, !is.finite(timesData))
Naturally, as I haven't specified a column I get:
Error in is.finite(timesData) :
default method not implemented for type 'list'
I tried lapply:
lapply(timesData, byrow=F, is.finite(timesData))
but
Error in FUN(X[[i]], ...) :
2 arguments passed to 'is.finite' which requires 1
So overall my question is how do I find the values in the dataset which are finite when 'summary()' doesn't reveal the columns where they reside and also how can I use lapply to then get rid of them?
My data is publicly available at kaggle: https://www.kaggle.com/mylesoneill/world-university-rankings