Running examples in ‘curl-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: curl_fetch_memory
> ### Title: Fetch the contents of a URL
> ### Aliases: curl_fetch_memory curl_fetch_disk curl_fetch_stream
> ###   curl_fetch_multi curl_fetch_echo
> 
> ### ** Examples
> 
> # Load in memory
> res <- curl_fetch_memory("http://httpbin.org/cookies/set?foo=123&bar=ftw")
> res$content
 [1] 7b 0a 20 20 22 63 6f 6f 6b 69 65 73 22 3a 20 7b 0a 20 20 20 20 22 62 61 72
[26] 22 3a 20 22 66 74 77 22 2c 20 0a 20 20 20 20 22 66 6f 6f 22 3a 20 22 31 32
[51] 33 22 0a 20 20 7d 0a 7d 0a
> 
> # Save to disk
> res <- curl_fetch_disk("http://httpbin.org/stream/10", tempfile())
> res$content
[1] "/home/hornik/tmp/scratch/Rtmp3y2aMd/file22c5311b6bc7"
> readLines(res$content)
 [1] "{\"url\": \"http://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-603d4bdb-38029fed163195187ed20c4c\", \"User-Agent\": \"R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)\", \"Accept\": \"*/*\", \"Accept-Encoding\": \"deflate, gzip, br\"}, \"origin\": \"137.208.57.142\", \"id\": 0}"
 [2] "{\"url\": \"http://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-603d4bdb-38029fed163195187ed20c4c\", \"User-Agent\": \"R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)\", \"Accept\": \"*/*\", \"Accept-Encoding\": \"deflate, gzip, br\"}, \"origin\": \"137.208.57.142\", \"id\": 1}"
 [3] "{\"url\": \"http://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-603d4bdb-38029fed163195187ed20c4c\", \"User-Agent\": \"R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)\", \"Accept\": \"*/*\", \"Accept-Encoding\": \"deflate, gzip, br\"}, \"origin\": \"137.208.57.142\", \"id\": 2}"
 [4] "{\"url\": \"http://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-603d4bdb-38029fed163195187ed20c4c\", \"User-Agent\": \"R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)\", \"Accept\": \"*/*\", \"Accept-Encoding\": \"deflate, gzip, br\"}, \"origin\": \"137.208.57.142\", \"id\": 3}"
 [5] "{\"url\": \"http://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-603d4bdb-38029fed163195187ed20c4c\", \"User-Agent\": \"R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)\", \"Accept\": \"*/*\", \"Accept-Encoding\": \"deflate, gzip, br\"}, \"origin\": \"137.208.57.142\", \"id\": 4}"
 [6] "{\"url\": \"http://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-603d4bdb-38029fed163195187ed20c4c\", \"User-Agent\": \"R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)\", \"Accept\": \"*/*\", \"Accept-Encoding\": \"deflate, gzip, br\"}, \"origin\": \"137.208.57.142\", \"id\": 5}"
 [7] "{\"url\": \"http://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-603d4bdb-38029fed163195187ed20c4c\", \"User-Agent\": \"R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)\", \"Accept\": \"*/*\", \"Accept-Encoding\": \"deflate, gzip, br\"}, \"origin\": \"137.208.57.142\", \"id\": 6}"
 [8] "{\"url\": \"http://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-603d4bdb-38029fed163195187ed20c4c\", \"User-Agent\": \"R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)\", \"Accept\": \"*/*\", \"Accept-Encoding\": \"deflate, gzip, br\"}, \"origin\": \"137.208.57.142\", \"id\": 7}"
 [9] "{\"url\": \"http://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-603d4bdb-38029fed163195187ed20c4c\", \"User-Agent\": \"R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)\", \"Accept\": \"*/*\", \"Accept-Encoding\": \"deflate, gzip, br\"}, \"origin\": \"137.208.57.142\", \"id\": 8}"
[10] "{\"url\": \"http://httpbin.org/stream/10\", \"args\": {}, \"headers\": {\"Host\": \"httpbin.org\", \"X-Amzn-Trace-Id\": \"Root=1-603d4bdb-38029fed163195187ed20c4c\", \"User-Agent\": \"R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu)\", \"Accept\": \"*/*\", \"Accept-Encoding\": \"deflate, gzip, br\"}, \"origin\": \"137.208.57.142\", \"id\": 9}"
> 
> # Stream with callback
> res <- curl_fetch_stream("http://www.httpbin.org/drip?duration=3&numbytes=15&code=200", function(x){
+   cat(rawToChar(x))
+ })
*************Error in readBin(con, raw(), 32768L) : 
  transfer closed with 2 bytes remaining to read
Calls: curl_fetch_stream -> readBin
Execution halted