yihui / printr

Some (magical) printing methods for knitr
https://yihui.org/printr/
118 stars 24 forks source link

Error when using summary() #21

Closed elinw closed 8 years ago

elinw commented 8 years ago

base::summary() causes a fatal error when present in a markdown file with printr.

Reproducible example

     library(printr)  
     summary(iris$Sepal.Length)

generates Error in provideDimnames(x, sep = sep, base = base) : 'dimnames' applied to non-array Calls: <Anonymous> ... eval -> eval -> data.frame -> do.call -> provideDimnames

dimnames(summary(iris$Sepal.Length)) is NULL

Using as.array(summary(iris$Sepal.Length)) solves it, but it was definitely unexpected by me at least.

elinw commented 8 years ago

Wow already fixed in master, nice!

octaviocipo commented 4 years ago

Thank you, you are a wonderful person

elenipb commented 2 years ago

Thank you so so so much!!!! I was stuck and thanks to your solution I was able to solve it!