How to treat missing data for this case?

I tried to get the ouptu but failed because of missing values. Could you let me know how to treat this missing values? I used na.rm=TRUE ot NA=TRUE but failed.


data<- read_csv("C:/Users/hwang/Desktop/EndersR/Datasets/quarterly.csv")
data.ts <- ts(data, start = c(1960, 1), end = c(2012, 4), fr = 4)

data$DATE = as.yearqtr(data$DATE)
data$spread = data$r5-data$Tbill

spec.ar7 = arfimaspec(mean.model=list(armaOrder=c(7,0),include.mean=TRUE))
fit.ar7 = arfimafit(spec=spec.ar7,data=data$spread)
Error in if (mean(data) == 0) { : missing value where TRUE/FALSE needed

Thank you in advance!



To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

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