Loading PNG files directly from URL

前端 未结 1 1782
栀梦
栀梦 2021-01-01 17:12

I am using the png package to load PNGs as raster images, and then plotting them. The PNGs are coming from an online source, namely, Wikipedia. I can get the fo

相关标签:
1条回答
  • 2021-01-01 18:07

    Use getURLcontent in the RCurl package.

    library(RCurl)
    myurl <- "http://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flag_of_Afghanistan.svg/150px-Flag_of_Afghanistan.svg.png"
    my_image <-  readPNG(getURLContent(myurl))
    
    0 讨论(0)
提交回复
热议问题