NA/NaN/Inf in 'y' with aov function for every dataset I import even ones that have previously worked

Starting a few weeks ago my RStudio app suddenly has the following errors for any dataset when I run aov or lm functions. I get an error about Nan/Inf variables in y. However these variables are not in the dataset I have confirmed "agedeath" in the following example is all numeric variables no zeroes, no blanks. But I also tried removing such variables once imported using R functions and it still gives me this error. I import datasets as shown below. I also tried this on datasets that have worked in the past but now they are also showing this error even though using the exact same code a month ago they worked fine. I dont understand what has happened and I have even tried importing the data using different functions and they still keep showing this error when I try to run the anova.

cohort.ages <- read.csv("~/VA PhD Thesis/PTSD/Cohort/cohort ages.csv")
View(cohort.ages)
attach(cohort.ages)
sample=aov(group ~ agedeath)
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'y'
In addition: Warning message:
In storage.mode(v) <- "double" : NAs introduced by coercion

We can't see your data, which makes it hard to help. if the data isn't huge, you might use dput(cohort.ages) and then copy and paste here.

But as a wild hare, if you clear your environment before running the code does that help?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.