[R] How to loop over two files ...

Ana Marija @okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Mon Jun 22 20:01:57 CEST 2020


Thank you so much as.character(r) indeed resolved the issue!

On Sat, Jun 20, 2020 at 3:47 AM Ivan Krylov <krylov.r00t using gmail.com> wrote:
>
> On Fri, 19 Jun 2020 19:36:41 -0500
> Ana Marija <sokovic.anamarija using gmail.com> wrote:
>
> > Error in cat(x, file = file, sep = c(rep.int(sep, ncolumns - 1),
> > "\n"),  : argument 1 (type 'list') cannot be handled by 'cat'
>
> It might be a good idea to try to solve problems like this yourself
> instead of waiting for hours for someone to reply. All the required
> information is there in the error message: write() fails because r is a
> list. Why is r a list? It's returned from GET(), so let's read its
> documentation.
>
> httr::GET() returns a response object, not a string [1]. Try passing
> as.character(r) or content(r,'text') instead of just r to write(...) or
> use a different way of extracting the actual response from the response
> object.
>
> --
> Best regards,
> Ivan
>
> [1] https://httr.r-lib.org/reference/GET.html



More information about the R-help mailing list