I am trying to compute the log of a column of a zoo data frame in R. Although all the data are positives numerics, R says (non-numeric argument to mathematical function).
Weirdly it works when applying to the data before they are transformed to a zoo data frame.
I cannot understand why.
Here is my code :
library(zoo)
data <- read.csv(file="dataecm/data.csv", sep = ";", stringsAsFactors=FALSE)
log(data$GDP) ### Works
datats<-zoo(data, order.by = data$DATE)
log(datats$GDP) ### Does not work -> (non-numeric argument to mathematical function)
By the way, when using View(datats) the zoo data frame look exactly the same as the dataframe read from csv.
Thank you for your help.