failed to use the formula acf

The syntax is correct

acf(lh,lag.max=48,ci=0.95)

using the built-in dataset lh. Why it's returning the error with your data argument is unclear. See the FAQ: How to do a minimal reproducible example reprex for beginners.