-1
bquote({
  A <- 4
  print(A)
})

output:

{
    A <- 4
    print(A)
}

What can I do so that the output is simply:

A <- 4
print(A)

1 Answers1

2

As @G.Grothendieck says in comments, you can't get rid of the brackets in the object, but you could get that output by doing:

for (i in 2:3) {
   print(b[[i]])
}

Or, overkill:

class(b) <- "foo"
print.foo <- function(x) for (i in 2:length(x)) print(x[[i]])
b
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453