Errors when trying to use View() on some objects

Hi -
I am getting this error and a blank tab when trying to View() certain list objects in Rstudio. I can print() the object and also expand it in the Environment pane, but it won't show up as a tab pane.
Error in || !is.character(output) :
'length = 3' in coercion to 'logical(1)'

Is no one else having this issue? Here is some code that will reproduce the error as long as you have a Census API key. When I View(response) I get an empty tab and this error:

Error in || !is.character(output) : 
  'length = 3' in coercion to 'logical(1)'
vars <- c("SEX","PWGTP","MAR")
region <- "public use microdata area:611"
regionin <- "state:25"
response <- getCensus("2021/acs/acs5/pums", vars = vars, region = region, regionin = regionin, show_call = TRUE)

query <- list(
  get = "SEX,PWGTP,MAR",
  `for` = "public use microdata area:611",
  `in` = "state:25",
  key = Sys.getenv("CENSUS_API_KEY")

response <- GET(
  url = "",
  query = query


Trying again to get a response on this one as it is a very annoying bug. Here is an even simpler example. The code works fine, but when I try to View(response), it doesn't work, I just get an empty tab.


response <- GET(glue(""))
> response
Response []
  Date: 2023-07-31 15:37
  Status: 200
  Content-Type: application/json;charset=utf-8
  Size: 411 kB
[{"dog_name":"Butch","dog_breed":"Mixed Breed","location_masked":{"type":"Point","coordinates":[-71.1328,42.3989]},"latitude_masked":"42.3989","longitude_m...
,{"dog_name":"Baxter","dog_breed":"Mixed Breed","location_masked":{"type":"Point","coordinates":[-71.1186,42.3814]},"latitude_masked":"42.3814","longitude_...
,{"dog_name":"Bodhi","dog_breed":"Golden Retriever","location_masked":{"type":"Point","coordinates":[-71.1308,42.3998]},"latitude_masked":"42.3998","longit...
,{"dog_name":"Jolene Almeida","dog_breed":"German Shorthaired Pointer","location_masked":{"type":"Point","coordinates":[-71.0896,42.368]},"latitude_masked"...
,{"dog_name":"Ruger","dog_breed":"Labrador Retriever","location_masked":{"type":"Point","coordinates":[-71.1353,42.3932]},"latitude_masked":"42.3932","long...
,{"dog_name":"FLASH","dog_breed":"Border Collie","location_masked":{"type":"Point","coordinates":[-71.1305,42.3981]},"latitude_masked":"42.3981","longitude...
,{"dog_name":"Leo","dog_breed":"French Bulldog","location_masked":{"type":"Point","coordinates":[-71.1415,42.3902]},"latitude_masked":"42.3902","longitude_...
> View(response)
Error in || !is.character(output) : 
  'length = 3' in coercion to 'logical(1)'

I would say it's expected that View() doesn't work well for every single object type imaginable. Here, for an http response, there may not be a well-defined way to represent it. You want to get the content out before you do too much, for example, try this:


response <- GET(glue(""))

content(response, as = "text") |>
  jsonlite::fromJSON() |>

Hi - thanks for replying. The issue here is that I never used to have this problem (any object would show in View()) and it seems to be a bug in View() introduced by changes in R 4.3.0, just based on the error message. It used to be that calling "||" with a condition longer than one just gave a warning, not an error as is happening here, so something in View() needs to be updated to correct this. Sometimes it's convenient to see the entirety of the response, and not just the parsed content. Also, this problem occurs for other objects than requests with HTTR, that is just the example I had handy.
If this is intended behavior of View() then at the very least the error message should be more informative.

1 Like

Indeed, I think you are right. If I'm not mistaken, this is the same problem described in this GitHub issue.

1 Like

Yes, that is the same issue. Thanks for pointing me to that.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.