0

I'm using a markdown document to write text from R. At some point, I want to add a table that I calculated using the table() function. But it's not working.

library(stargazer)
x=structure(c(2075L, 49L), .Dim = 2L, .Dimnames = structure(list(
    c("0", "1")), .Names = ""), class = "table")

stargazer(x)

Error in objects[[i]]$zelig.call : 
  $ operator is invalid for atomic vectors

What's going on and how do I fix it?

Bono
  • 4,757
  • 6
  • 48
  • 77
M. Beausoleil
  • 3,141
  • 6
  • 29
  • 61

1 Answers1

1

How about something like this?

stargazer(as.data.frame(x),
          type = 'text',
          summary = FALSE,
          rownames = FALSE)
sbstn
  • 628
  • 3
  • 7