uncool
uncool

Reputation: 2703

Building custom print function, digits argument causes error

I am simply trying to limit the decimals for my output. But the digits argument is giving me trouble.

My code

#' @export
print.xts <- function(x) {
  print(x, digits = 5)

}

Gives the error when printing an xts object

Error in print.xts(x, digits = 5) : unused argument (digits = 5) 

What can be the issue?

Upvotes: 1

Views: 448

Answers (1)

JCollerton
JCollerton

Reputation: 3327

There already exists a print.xts method in the xts package, try renaming the function which should work.

Upvotes: 1

Related Questions