0

I have a CSV file which contains a column of data in the following format %m/%d/%Y %H:%M:%S. From reading on this site I believe the best solution is to use the read.zoo() function.

I installed the zoo package from the CRAN repository and load the zoo package at the start of my script.

When I run the following code I get an

Error: could not find function "read.zoo"`

library(zoo)
DataSampler <- read.zoo("DataSampler.csv", tz = "", header = T, 
    format = '%m/%d/%Y %H:%M:%S')

Can anyone help me out and tell me why I am getting such an error?

I read the documentation regarding the zoo package but there is no reference to what packages and libraries are required.

symbolrush
  • 7,123
  • 1
  • 39
  • 67
TheGoat
  • 2,587
  • 3
  • 25
  • 58
  • 1
    Are you sure you installed the package right? The `read.zoo` function is definitively part of the `zoo` package and if the package is loaded you should not get this error. I don't get it if I run your code. Do you get any output when running `library(zoo)`? You can also try `DataSampler <- zoo::read.zoo("DataSampler.csv", tz = "", header = T, format = '%m/%d/%Y %H:%M:%S')` – symbolrush Oct 12 '16 at 07:24
  • There must be an issue with installing the package via tools -> install packages as I successfully installed zoo using this method but when I ran `library(zoo)` I got the following error: `Error in library(zoo) : there is no package called ‘zoo’` When I ran install.packages("zoo") the code works correctly!!! – TheGoat Oct 12 '16 at 07:29

0 Answers0