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")
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