I need to check if the url redirects to another page in R. Is it possible ?
Check out the httr
package, and there the GET
function:
> library(httr)
> names(GET("http://www.stackoverflow.com"))
[1] "url" "handle" "status_code" "headers" "cookies"
[6] "content" "times" "config"
> GET("http://www.stackoverflow.com")$status_code
[1] 200
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With