how stop content from print time on console

When I use content function, there is time print on console (0s). i would like to stop this message from printing on the console.

library(httr)
res <- GET("http://comtrade.un.org/api/get?type=C&freq=A&px=HS&ps=2013&r=842&p=0&rg=all&cc=TOTAL&fmt=csv")
httr::content(res, "parsed", encoding = "UTF-8", show_col_types = FALSE)

You could save the object to a variable and then it doesn't happen. Still not sure WHY it is happening though.

library(httr)
res <- GET("http://comtrade.un.org/api/get?type=C&freq=A&px=HS&ps=2013&r=842&p=0&rg=all&cc=TOTAL&fmt=csv")
datin <- httr::content(res, "parsed", encoding = "UTF-8", show_col_types = FALSE)

datin
#> # A tibble: 3 x 35
#>   Classification  Year Period `Period Desc.` `Aggregate Level` `Is Leaf Code`
#>   <chr>          <dbl>  <dbl>          <dbl>             <dbl>          <dbl>
#> 1 H4              2013   2013           2013                 0              0
#> 2 H4              2013   2013           2013                 0              0
#> 3 H4              2013   2013           2013                 0              0
#> # ... with 29 more variables: Trade Flow Code <dbl>, Trade Flow <chr>,
#> #   Reporter Code <dbl>, Reporter <chr>, Reporter ISO <chr>,
#> #   Partner Code <dbl>, Partner <chr>, Partner ISO <chr>,
#> #   2nd Partner Code <lgl>, 2nd Partner <lgl>, 2nd Partner ISO <lgl>,
#> #   Customs Proc. Code <lgl>, Customs <lgl>, Mode of Transport Code <lgl>,
#> #   Mode of Transport <lgl>, Commodity Code <chr>, Commodity <chr>,
#> #   Qty Unit Code <dbl>, Qty Unit <chr>, Qty <lgl>, ...

Created on 2021-11-12 by the reprex package (v2.0.1)

i did what you said, but it keeps showing if you are running the code in a loop

Share a reproducible example so we can help a bit better.

reproducible example

library(httr)
for (i in c(4, 8, 36)){
res <- GET(paste0("http://comtrade.un.org/api/get?type=C&freq=A&px=HS&ps=2013&r=", i, "&p=0&rg=all&cc=TOTAL&fmt=csv"))
x <- httr::content(res, "parsed", encoding = "UTF-8", show_col_types = FALSE)
}

This topic was automatically closed 21 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.