Warning message NaNs Produced

Hi, I am trying to create a time series looking at the change in daily streamflow, but am having trouble with zeros in the time series . Each time series point is the change in streamflow (i.e., streamflow from today minus streamflow from yesterday), so when the streamflow from today equals the streamflow from yesterday the change in daily streamflow creates a value of zero. I uploaded the streamflow timeseries into R and currently have the following code:

full.dat <- read.csv("full.csv") # reads in the data
changeFull.ts <- ts(log10(full.dat$DailyChange)) # create a log-transformed time series for daily change in streamflow

When I run the code for changeFull.ts, I receive the warning message "Error in is.data.frame(data) : NaNs produced". I assume that this is due to dates where streamflow is unchanged resulting in a null value.

I then tried using the na.omit() command to remove the null data using the code:

changeRevFull.ts <- ts(na.omit(fullZerosRem.dat$DailyChange))

However, I still receive the warning message "Error in is.data.frame(data) : NaNs produced"

Does anyone have any ideas on how to proceed with creating a time series that is able to include zero values without receiving a warning message? TIA.

Why do you wish to log transform your time series data ?

I log transformed the time series since my supervisor informed me that it is common practice to log transform to ensure that the data meets the required assumptions. Do you think that the log transformation is creating the error?

log(0) is problematic;
what are the required assumptions for your analysis?

Stationarity and univariate data. I guess that I do not need to log transform the data. Thanks.

I ran the time series on the untransformed data and it works. Thank you.

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.