How to use boxcox function in R

#1
I run the following code in R:

boxcox(data, lambda = seq(-2,2), interp=TRUE, plotit=TRUE)

Where data is a vector of integers, but I get the error

Error: $ operator is invalid for atomic vectors

How can I fix this? Furthermore, how can I specify how much I want the lambda to increment by?
 

trinker

ggplot2orBust
#3
When you're posting code, dataframes or computer output it's helpful to wrap this information in code tags by:
  1. either clicking the pound (#) sign icon or
  2. wrap with [NOPARSE]
    Code:
    some code
    [/NOPARSE]

which produces:
Code:
some code
For more see this (LINK)